From e9127cf295f67d27f88a375e7c5d042bf38b43f1 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Mon, 5 Sep 2011 22:45:10 +0000 Subject: [PATCH] Fix saving when ZoteroPane.getSelectedLibraryID() or ZoteroPane.getSelectedCollection() throw because the Zotero pane has not yet been opened. --- chrome/content/zotero/browser.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/chrome/content/zotero/browser.js b/chrome/content/zotero/browser.js index 698615886..4c066879d 100644 --- a/chrome/content/zotero/browser.js +++ b/chrome/content/zotero/browser.js @@ -150,12 +150,12 @@ var Zotero_Browser = new function() { } // get libraryID and collectionID - var libraryID, collectionID; + var libraryID = null, collectionID = null; if(ZoteroPane && !Zotero.isConnector) { - libraryID = ZoteroPane.getSelectedLibraryID(); - collectionID = ZoteroPane.getSelectedCollection(true); - } else { - libraryID = collectionID = null; + try { + libraryID = ZoteroPane.getSelectedLibraryID(); + collectionID = ZoteroPane.getSelectedCollection(true); + } catch(e) {} } // translate into specified library and collection