From b850d16c895fa1737e7a42399671c72f382057c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adomas=20Ven=C4=8Dkauskas?= Date: Fri, 8 Apr 2022 10:41:27 +0300 Subject: [PATCH] Fix integration error handling code when citeproc-rs disabled. Closes #2508 --- chrome/content/zotero/xpcom/integration.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/chrome/content/zotero/xpcom/integration.js b/chrome/content/zotero/xpcom/integration.js index 625948e862..abe8874652 100644 --- a/chrome/content/zotero/xpcom/integration.js +++ b/chrome/content/zotero/xpcom/integration.js @@ -371,11 +371,14 @@ Zotero.Integration = new function() { Zotero.launchURL(supportURL); } - // If the driver panicked we cannot reuse it - if (e instanceof Zotero.CiteprocRs.CiteprocRsDriverError) { - session.style.free(true); - delete Zotero.Integration.sessions[session.id]; - } + // CiteprocRsDriverError available only if citeproc-rs is enabled + try { + // If the driver panicked we cannot reuse it + if (e instanceof Zotero.CiteprocRs.CiteprocRsDriverError) { + session.style.free(true); + delete Zotero.Integration.sessions[session.id]; + } + } catch (e) {} } finally { Zotero.logError(e);