From bd7ff9c2c653c9d7b22b5add3065c4e4af767abc Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 1 Apr 2010 18:01:11 +0000 Subject: [PATCH] Fix upgrade error for custom styles with invalid ids --- chrome/content/zotero/xpcom/schema.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/chrome/content/zotero/xpcom/schema.js b/chrome/content/zotero/xpcom/schema.js index 0c90a5565..961bb3dff 100644 --- a/chrome/content/zotero/xpcom/schema.js +++ b/chrome/content/zotero/xpcom/schema.js @@ -2343,10 +2343,16 @@ Zotero.Schema = new function(){ if (!matches) { continue; } - file.append(matches[1]); - Zotero.debug("Extracting styles '" + matches[1] + "' from database"); - Zotero.File.putContents(file, row.csl); - Zotero.wait(); + try { + Zotero.debug("Extracting styles '" + matches[1] + "' from database"); + file.append(matches[1]); + Zotero.File.putContents(file, row.csl); + Zotero.wait(); + } + catch (e) { + Zotero.debug(e); + Components.utils.reportError("Skipping style '" + matches[1] + "'"); + } } Zotero.Styles.init(); }