diff --git a/chrome/chromeFiles/content/scholar/data_access.js b/chrome/chromeFiles/content/scholar/data_access.js index 2f532a2b4..1ecbe84fa 100644 --- a/chrome/chromeFiles/content/scholar/data_access.js +++ b/chrome/chromeFiles/content/scholar/data_access.js @@ -183,12 +183,12 @@ Scholar.Item.prototype.setCreator = function(orderIndex, firstName, lastName, cr this._loadCreators(); } - if (!creatorTypeID){ - creatorTypeID = 1; + if (!firstName){ + firstName = ''; } - if (!firstName && !lastName){ - throw ('Name not provided for creator'); + if (!lastName){ + lastName = ''; } if (this._creators.has(orderIndex) && @@ -198,6 +198,10 @@ Scholar.Item.prototype.setCreator = function(orderIndex, firstName, lastName, cr return true; } + if (!creatorTypeID){ + creatorTypeID = 1; + } + var creator = new Array(); creator['firstName'] = firstName; creator['lastName'] = lastName; @@ -222,7 +226,8 @@ Scholar.Item.prototype.removeCreator = function(orderIndex){ } this._creators.remove(orderIndex); - for (var i=orderIndex,len=this._creators.length; i<=len; i++){ + // Go to length+1 so we clear the last one + for (var i=orderIndex, max=this._creators.length+1; i