From 8a8093028de2cf31fc90290207a76656950b9756 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Fri, 9 Aug 2013 11:00:55 -0400 Subject: [PATCH] Check if callback exists before calling --- chrome/content/zotero/xpcom/zotero.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index 7dbe63ba8d..76471f6486 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -814,10 +814,10 @@ Components.utils.import("resource://gre/modules/Services.jsm"); Zotero.DB.closeDatabase().then(function() { // broadcast that DB lock has been released Zotero.IPC.broadcast("lockReleased"); - callback(); + if(callback) callback(); }); } else { - callback(); + if(callback) callback(); } } catch(e) { Zotero.debug(e);