Don't die if a creator is missing at an index
This commit is contained in:
parent
9fa7dc5249
commit
078efc4042
1 changed files with 18 additions and 0 deletions
|
@ -1266,6 +1266,15 @@ Zotero.ItemTreeView.prototype.sort = function(itemID)
|
||||||
aPos++;
|
aPos++;
|
||||||
var aFound = false;
|
var aFound = false;
|
||||||
while (aPos < aNumCreators) {
|
while (aPos < aNumCreators) {
|
||||||
|
// Don't die if there's no creator at an index
|
||||||
|
if (!aCreators[aPos]) {
|
||||||
|
Components.utils.reportError(
|
||||||
|
"Creator is missing at position " + aPos
|
||||||
|
+ " for item " + a.ref.libraryID + "/" + a.ref.key
|
||||||
|
);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (aCreators[aPos].creatorTypeID == aFirstCreatorTypeID) {
|
if (aCreators[aPos].creatorTypeID == aFirstCreatorTypeID) {
|
||||||
aFound = true;
|
aFound = true;
|
||||||
break;
|
break;
|
||||||
|
@ -1276,6 +1285,15 @@ Zotero.ItemTreeView.prototype.sort = function(itemID)
|
||||||
bPos++;
|
bPos++;
|
||||||
var bFound = false;
|
var bFound = false;
|
||||||
while (bPos < bNumCreators) {
|
while (bPos < bNumCreators) {
|
||||||
|
// Don't die if there's no creator at an index
|
||||||
|
if (!bCreators[bPos]) {
|
||||||
|
Components.utils.reportError(
|
||||||
|
"Creator is missing at position " + bPos
|
||||||
|
+ " for item " + b.ref.libraryID + "/" + b.ref.key
|
||||||
|
);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (bCreators[bPos].creatorTypeID == bFirstCreatorTypeID) {
|
if (bCreators[bPos].creatorTypeID == bFirstCreatorTypeID) {
|
||||||
bFound = true;
|
bFound = true;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue