Skip to content

Commit

Permalink
Nullability tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
Technici4n committed Jul 5, 2024
1 parent c1b91d6 commit 60dcdf5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ private void closeConfig(final ModConfig config) {
LOGGER.trace(CONFIG, "Closing config file type {} at {} for {}", config.getType(), config.getFileName(), config.getModId());
unload(config);
config.config = null;
config.getSpec().acceptConfig(null);
config.postConfigEvent(ModConfigEvent.Unloading::new);
} else {
LOGGER.warn(CONFIG, "Closing non-file config {} at path {}", config.config, config.getFileName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.electronwill.nightconfig.core.CommentedConfig;
import com.electronwill.nightconfig.core.Config;
import com.electronwill.nightconfig.core.UnmodifiableCommentedConfig;
import org.jetbrains.annotations.Nullable;

/**
* A config spec is responsible for interpreting (loading, correcting) raw {@link CommentedConfig}s from NightConfig.
Expand Down Expand Up @@ -52,5 +53,5 @@ public interface IConfigSpec {
* This is called on loading and on reloading.
* The config is guaranteed to be valid according to {@link #isCorrect}.
*/
void acceptConfig(CommentedConfig config);
void acceptConfig(@Nullable CommentedConfig config);
}

0 comments on commit 60dcdf5

Please sign in to comment.