From d805427ae6d7a61d1c9d6563ee073c9fbb9871da Mon Sep 17 00:00:00 2001 From: RomanManz Date: Sat, 24 Sep 2016 12:24:29 +0200 Subject: [PATCH] Small bugfix to prevent null pointer exception (#2116) --- lib/timeline/component/ItemSet.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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);