Skip to content

Commit 36a0491

Browse files
committed
null source check in validators of viewDistance and disableSpawnChunks
1 parent ea58bb7 commit 36a0491

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/main/java/carpet/settings/CarpetSettings.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ private static class ViewDistanceValidator extends Validator<Integer>
642642
{
643643
@Override public Integer validate(CommandSource source, ParsedRule<Integer> currentRule, Integer newValue, String string)
644644
{
645-
if (currentRule.get().equals(newValue))
645+
if (currentRule.get().equals(newValue) || source == null)
646646
{
647647
return newValue;
648648
}
@@ -681,6 +681,7 @@ private static class ViewDistanceValidator extends Validator<Integer>
681681
private static class DisableSpawnChunksValidator extends Validator<Boolean>
682682
{
683683
@Override public Boolean validate(CommandSource source, ParsedRule<Boolean> currentRule, Boolean newValue, String string) {
684+
if (source == null) return newValue;
684685
if (!newValue)
685686
Messenger.m(source, "w Spawn chunks re-enabled. Visit spawn to load them?");
686687
return newValue;

0 commit comments

Comments
 (0)