src/js/serializers/CinecastSerializer.js
branchnew-model
changeset 882 61c384dda19e
parent 875 43629caa77bc
--- a/src/js/serializers/CinecastSerializer.js	Fri Apr 27 19:18:21 2012 +0200
+++ b/src/js/serializers/CinecastSerializer.js	Thu May 03 17:52:52 2012 +0200
@@ -153,7 +153,7 @@
         IriSP.jQuery.getJSON(_url, _callback)
     },
     deSerialize : function(_data, _source) {
-        if (typeof _data !== "object" && _data === null) {
+        if (typeof _data !== "object" || _data === null) {
             return;
         }
         if (typeof _data.imports !== "undefined") {
@@ -163,7 +163,7 @@
         }
         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;