From d605e54a1c5f2c09f943a7711edb5ab056b1585f Mon Sep 17 00:00:00 2001 From: Tobias Ottenweller Date: Wed, 16 May 2012 22:45:54 +0200 Subject: [PATCH] added validation before serialization --- src/org/mcteam/ancientgates/Gate.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/org/mcteam/ancientgates/Gate.java b/src/org/mcteam/ancientgates/Gate.java index 7dfa95a..7906457 100644 --- a/src/org/mcteam/ancientgates/Gate.java +++ b/src/org/mcteam/ancientgates/Gate.java @@ -89,6 +89,8 @@ public class Gate extends BaseGate implements ConfigurationSerializable public Map serialize() { + validate(); // make sure to not write invalid stuff to disk + Map retVal = new HashMap(); retVal.put(idKey, id); @@ -131,6 +133,7 @@ public class Gate extends BaseGate implements ConfigurationSerializable gate.id = id; instances.put(gate.id, gate); Plugin.log("created new gate " + gate.id); + return gate; }