From 5dd76cf908a3bad8dc099e317d62dbd5bbe8787c Mon Sep 17 00:00:00 2001 From: "BT (calcastor/mame)" <43831917+calcastor@users.noreply.github.com> Date: Fri, 10 Sep 2021 15:42:56 -0700 Subject: [PATCH] Re-add WorldTimeModule null check to prevent potential GameRulesMatchModule NPE Co-authored-by: William Jeffcock Signed-off-by: BT (calcastor/mame) <43831917+calcastor@users.noreply.github.com> --- .../main/java/tc/oc/pgm/gamerules/GameRulesMatchModule.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/tc/oc/pgm/gamerules/GameRulesMatchModule.java b/core/src/main/java/tc/oc/pgm/gamerules/GameRulesMatchModule.java index dc3be19701..71050ef72b 100644 --- a/core/src/main/java/tc/oc/pgm/gamerules/GameRulesMatchModule.java +++ b/core/src/main/java/tc/oc/pgm/gamerules/GameRulesMatchModule.java @@ -24,7 +24,8 @@ public void load() { this.match .getWorld() .setGameRuleValue( - GameRule.DO_DAYLIGHT_CYCLE.getId(), Boolean.toString(!wtm.isTimeLocked())); + GameRule.DO_DAYLIGHT_CYCLE.getId(), + Boolean.toString(wtm != null && !wtm.isTimeLocked())); // second, set any gamerules defined in the map's XML // doDaylightCycle set in XML's gamerules module will take precedence over timelock