From 9ab13addd13fd7c5cbf8cec770c2c26e6873df30 Mon Sep 17 00:00:00 2001 From: Ira Date: Sun, 17 Jul 2022 14:34:47 -0400 Subject: [PATCH] Added some null checks to readResolve in LightSource, MacroButtonProperties, and Zone --- src/main/java/net/rptools/maptool/model/LightSource.java | 3 +++ .../java/net/rptools/maptool/model/MacroButtonProperties.java | 2 ++ src/main/java/net/rptools/maptool/model/Zone.java | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/src/main/java/net/rptools/maptool/model/LightSource.java b/src/main/java/net/rptools/maptool/model/LightSource.java index 48504b291e..02d677f6a2 100644 --- a/src/main/java/net/rptools/maptool/model/LightSource.java +++ b/src/main/java/net/rptools/maptool/model/LightSource.java @@ -225,6 +225,9 @@ private Object readResolve() { if (type == null) { type = Type.NORMAL; } + if (lightList == null) { + lightList = new LinkedList<>(); + } return this; } diff --git a/src/main/java/net/rptools/maptool/model/MacroButtonProperties.java b/src/main/java/net/rptools/maptool/model/MacroButtonProperties.java index 5a605a3ce3..4e6144207e 100644 --- a/src/main/java/net/rptools/maptool/model/MacroButtonProperties.java +++ b/src/main/java/net/rptools/maptool/model/MacroButtonProperties.java @@ -1105,6 +1105,8 @@ public Object readResolve() { if (compareApplyToSelectedTokens == null) compareApplyToSelectedTokens = true; if (allowPlayerEdits == null) allowPlayerEdits = AppPreferences.getAllowPlayerMacroEditsDefault(); + if (macroUUID == null) macroUUID = getMacroUUID(); + if (displayHotKey == null) displayHotKey = true; return this; } diff --git a/src/main/java/net/rptools/maptool/model/Zone.java b/src/main/java/net/rptools/maptool/model/Zone.java index 2c8d9b9f70..41314acf8e 100644 --- a/src/main/java/net/rptools/maptool/model/Zone.java +++ b/src/main/java/net/rptools/maptool/model/Zone.java @@ -2110,6 +2110,10 @@ protected Object readResolve() { if (aStarRounding == null) { aStarRounding = AStarRoundingOptions.NONE; } + + if (tokenSelection == null) { + tokenSelection = TokenSelection.ALL; + } return this; }