lib/json_serialization: don't register objects more than once
authorAlexis Laferrière <alexis.laf@xymus.net>
Sat, 16 May 2015 14:20:51 +0000 (10:20 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Mon, 18 May 2015 22:04:42 +0000 (18:04 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

lib/json_serialization.nit

index 69f42bb..8b4ee97 100644 (file)
@@ -111,7 +111,7 @@ class JsonDeserializer
        redef fun notify_of_creation(new_object)
        do
                var id = just_opened_id
-               assert id != null
+               if id == null then return # Register `new_object` only once
                id_to_object[id] = new_object
        end