From f37a225a30e2212420e2eb3cda29b33068a34298 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Tue, 26 Jun 2012 11:59:03 -0400 Subject: [PATCH] Fix saving snapshots --- chrome/content/zotero/xpcom/progressWindow.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/xpcom/progressWindow.js b/chrome/content/zotero/xpcom/progressWindow.js index 71f8369a0..4ba17faa6 100644 --- a/chrome/content/zotero/xpcom/progressWindow.js +++ b/chrome/content/zotero/xpcom/progressWindow.js @@ -191,8 +191,12 @@ Zotero.ProgressWindow = function(_window){ * Adds a line to the progress window with the specified icon */ this.addLines = _deferUntilWindowLoad(function addLines(labels, icons) { - for (var i in labels) { - new this.ItemProgress(icons[i], labels[i]); + if(typeof labels === "object" && typeof icons === "object") { + for (var i in labels) { + new this.ItemProgress(icons[i], labels[i]); + } + } else { + new this.ItemProgress(icons, labels); } _move(); @@ -433,7 +437,7 @@ Zotero.ProgressWindow = function(_window){ */ function _deferUntilWindowLoad(fn) { return function() { - if(_window.closed) return; + if(_window && _window.closed) return; if(_windowLoaded) { fn.apply(this, Array.prototype.slice.call(arguments));