src/js/serializers/PlatformSerializer.js
branchnew-model
changeset 882 61c384dda19e
parent 880 4c7b33bf2795
child 900 7673d645a8e0
--- a/src/js/serializers/PlatformSerializer.js	Fri Apr 27 19:18:21 2012 +0200
+++ b/src/js/serializers/PlatformSerializer.js	Thu May 03 17:52:52 2012 +0200
@@ -141,12 +141,12 @@
         IriSP.jQuery.getJSON(_url, _callback)
     },
     deSerialize : function(_data, _source) {
-        if (typeof _data !== "object" && _data === null) {
+        if (typeof _data !== "object" || _data === null) {
             return;
         }
         IriSP._(this.types).forEach(function(_type, _typename) {
             var _listdata = _data[_type.serialized_name];
-            if (typeof _listdata !== "undefined") {
+            if (typeof _listdata !== "undefined" && _listdata !== null) {
                 var _list = new IriSP.Model.List(_source.directory);
                 if (_listdata.hasOwnProperty("length")) {
                     var _l = _listdata.length;