From c39a489ca92a64914b6f9ecf82d35eadb822cd7b Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Fri, 20 Jul 2012 13:37:03 -0400 Subject: [PATCH] Fix deleting citations if dialog is cancelled --- chrome/content/zotero/xpcom/integration.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/chrome/content/zotero/xpcom/integration.js b/chrome/content/zotero/xpcom/integration.js index 2081cad7b5..bb2530275f 100644 --- a/chrome/content/zotero/xpcom/integration.js +++ b/chrome/content/zotero/xpcom/integration.js @@ -1796,6 +1796,9 @@ Zotero.Integration.CitationEditInterface = function(citation, field, fieldGetter me._fieldIndex = fieldIndex; return me._acceptDeferred.promise; }).then(function(progressCallback) { + if(!me.citation.citationItems.length) { + throw new Zotero.Exception.UserCancelled("inserting citation"); + } me._fieldGetter.progressCallback = progressCallback; return me._updateSession(true); }).then(function() {