From be58a1c0f3063f7729b831d401bad83f4abe477e Mon Sep 17 00:00:00 2001 From: yoyosource Date: Thu, 22 Apr 2021 19:44:32 +0200 Subject: [PATCH] Fix RegionUtils.save NPE --- .../src/de/steamwar/bausystem/region/RegionUtils.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/region/RegionUtils.java b/BauSystem_Main/src/de/steamwar/bausystem/region/RegionUtils.java index 0309cdf9..2a409002 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/region/RegionUtils.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/region/RegionUtils.java @@ -29,7 +29,9 @@ public class RegionUtils { } static void save(Region region) { - region.regionData.add("prototype", region.getPrototype().getName()); + if (region.getPrototype() != null) { + region.regionData.add("prototype", region.getPrototype().getName()); + } region.regionData.add("flagStorage", FlagStorage.toYAPION(region.getFlagStorage())); RegionLoader.save(); }