src/js/serializers/PlatformSerializer.js
branchnew-model
changeset 875 43629caa77bc
parent 872 d777d05a16e4
child 876 03967b6ada7c
--- a/src/js/serializers/PlatformSerializer.js	Fri Apr 20 19:13:11 2012 +0200
+++ b/src/js/serializers/PlatformSerializer.js	Mon Apr 23 19:11:08 2012 +0200
@@ -80,11 +80,13 @@
                 _res.title = _data.content.title || "";
                 _res.description = _data.content.description || "";
                 _res.created = IriSP.Model.isoToDate(_data.meta["dc:created"]);
-                var _c = parseInt(_data.color).toString(16);
-                while (_c.length < 6) {
-                    _c = '0' + _c;
+                if (typeof _data.color !== "undefined") {
+                    var _c = parseInt(_data.color).toString(16);
+                    while (_c.length < 6) {
+                        _c = '0' + _c;
+                    }
+                    _res.color = '#' + _c;
                 }
-                _res.color = '#' + _c;
                 _res.setMedia(_data.media, _source);
                 _res.setAnnotationType(_data.meta["id-ref"]);
                 _res.setTags(IriSP._(_data.tags).pluck("id-ref"));