diff --git a/lib/timeline/component/ItemSet.js b/lib/timeline/component/ItemSet.js index eeec817a..77912821 100644 --- a/lib/timeline/component/ItemSet.js +++ b/lib/timeline/component/ItemSet.js @@ -880,7 +880,7 @@ ItemSet.prototype._onUpdate = function(ids) { ids.forEach(function (id) { var itemData = me.itemsData.get(id, me.itemOptions); var item = me.items[id]; - var type = me._getType(itemData); + var type = itemData ? me._getType(itemData) : null; var constructor = ItemSet.types[type]; var selected; @@ -898,7 +898,7 @@ ItemSet.prototype._onUpdate = function(ids) { } } - if (!item) { + if (!item && itemData) { // create item if (constructor) { item = new constructor(itemData, me.conversion, me.options);