iconGrid: Actually throw programmer errors

This way we get a backtrace.
This commit is contained in:
Jasper St. Pierre 2013-10-30 13:05:20 -04:00
parent af06b78605
commit 17421e8a63

View File

@ -423,10 +423,8 @@ const IconGrid = new Lang.Class({
},
addItem: function(item, index) {
if (!item.icon || !item.icon instanceof BaseIcon) {
log('Only items with a BaseIcon icon property can be added to IconGrid');
return;
}
if (!item.icon instanceof BaseIcon)
throw new Error('Only items with a BaseIcon icon property can be added to IconGrid');
this._items.push(item);
if (index !== undefined)