Browse Source

Small bugfix to prevent null pointer exception (#2116)

codeClimate
RomanManz 8 years ago
committed by Alexander Wunschik
parent
commit
d805427ae6
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      lib/timeline/component/ItemSet.js

+ 2
- 2
lib/timeline/component/ItemSet.js View File

@ -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);

Loading…
Cancel
Save