Skip to content

Commit

Permalink
null pointer issue v2
Browse files Browse the repository at this point in the history
  • Loading branch information
rotgruengelb committed Mar 30, 2024
1 parent ca12d6c commit c9695f6
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

public class RuleSetDataManager extends JsonDataLoader implements IdentifiableResourceReloadListener {
private static final Gson GSON = new GsonBuilder().setPrettyPrinting().disableHtmlEscaping()
Expand All @@ -39,7 +40,7 @@ public static void register(DynamicRegistryManager registryManager) {
}

public static RuleSet getRuleSet(Identifier identifier, World world) {
return world.getRegistryManager().get(LandscapeRegistries.RULESETS).get(identifier);
return Objects.requireNonNullElse(world.getRegistryManager().get(LandscapeRegistries.RULESETS).get(identifier), RuleSet.EMPTY_RULESET);
}

public static Map<Identifier, RuleSet> getRuleSets() {
Expand Down

0 comments on commit c9695f6

Please sign in to comment.