Fix error selecting item with item type without creator types

https://forums.zotero.org/discussion/69118/
This commit is contained in:
Dan Stillman 2017-11-28 23:22:11 -05:00
parent d5dd5c5100
commit 76b96a8b07

View file

@ -219,7 +219,6 @@ Zotero.CreatorTypes = new function() {
Zotero.CachedTypes.apply(this, arguments);
this.constructor.prototype = new Zotero.CachedTypes();
this.getTypesForItemType = getTypesForItemType;
this.isValidForItemType = isValidForItemType;
this._typeDesc = 'creator type';
@ -267,11 +266,10 @@ Zotero.CreatorTypes = new function() {
});
function getTypesForItemType(itemTypeID) {
this.getTypesForItemType = function (itemTypeID) {
if (!_creatorTypesByItemType[itemTypeID]) {
throw new Error("Creator types not loaded for itemTypeID " + itemTypeID);
return [];
}
return _creatorTypesByItemType[itemTypeID];
}