From 20fa07617632d15b07ffa035231a6e2f10157d8b Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 3 Apr 2021 18:26:18 +0200 Subject: [PATCH] Fix NPE --- .../de/steamwar/bausystem/commands/CommandTPSLimiter.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandTPSLimiter.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandTPSLimiter.java index a592cb6..35101f5 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandTPSLimiter.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandTPSLimiter.java @@ -167,8 +167,10 @@ public class CommandTPSLimiter extends SWCommand { public static void setTPS(double d) { if (d < 0.5) d = 0.5; if (d > (TPSUtils.isWarpAllowed() ? 40 : 20)) d = (TPSUtils.isWarpAllowed() ? 40 : 20); - currentTPSLimit = d; - instance.tpsLimiter(); + if (instance != null) { + currentTPSLimit = d; + instance.tpsLimiter(); + } } }