Duplicate handler list before running handlers, in case it is modified while running.
This commit is contained in:
parent
335395f05f
commit
764e851e11
1 changed files with 3 additions and 2 deletions
|
@ -849,10 +849,11 @@ Zotero.Translate.Base.prototype = {
|
|||
args.push(arguments[i]);
|
||||
}
|
||||
|
||||
for(var i=0; i<this._handlers[type].length; i++) {
|
||||
var handlers = this._handlers[type].slice();
|
||||
for(var i=0, n=handlers.length; i<n; i++) {
|
||||
Zotero.debug("Translate: Running handler "+i+" for "+type, 5);
|
||||
try {
|
||||
returnValue = this._handlers[type][i].apply(null, args);
|
||||
returnValue = handlers[i].apply(null, args);
|
||||
} catch(e) {
|
||||
if(this._parentTranslator) {
|
||||
// throw handler errors if they occur when a translator is
|
||||
|
|
Loading…
Add table
Reference in a new issue