diff --git a/app/models/entity.js b/app/models/entity.js index e6af0b6..885c899 100644 --- a/app/models/entity.js +++ b/app/models/entity.js @@ -8,8 +8,6 @@ export default DS.Model.extend({ poll: function() { var _this = this; Ember.run.later( function() { - Ember.debug("reload"); - _this.reload(); _this.poll(); }, 1000); diff --git a/app/serializers/application.js b/app/serializers/application.js index c71ef80..e388765 100644 --- a/app/serializers/application.js +++ b/app/serializers/application.js @@ -39,16 +39,18 @@ export default DS.RESTSerializer.extend({ } } - item.contextElement.attributes.forEach(function(attribute) { - var property = { - name: attribute.name, - value: attribute.value, - type: attribute.type, - timestamp: attribute.metadatas[0].value - } + if (item.contextElement.attributes) { + item.contextElement.attributes.forEach(function(attribute) { + var property = { + name: attribute.name, + value: attribute.value, + type: attribute.type, + timestamp: attribute.metadatas[0].value + } - entity.attributes.properties.push(property); - }); + entity.attributes.properties.push(property); + }); + } // pass entity to caller function if (handleEntity(entity) == false) {