From 9a2aec970d18001810221de024cb048acf34b397 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sun, 20 Feb 2022 23:06:49 -0500 Subject: [PATCH] Load styles list in preferences even if custom style has an invalid date A bundled style will get replaced from the repo if it has an invalid date, but a custom style would result in an empty list. https://forums.zotero.org/discussion/comment/399774/#Comment_399774 --- chrome/content/zotero/preferences/preferences_cite.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/preferences/preferences_cite.jsx b/chrome/content/zotero/preferences/preferences_cite.jsx index 16f358c914..ae9b538736 100644 --- a/chrome/content/zotero/preferences/preferences_cite.jsx +++ b/chrome/content/zotero/preferences/preferences_cite.jsx @@ -91,9 +91,10 @@ Zotero_Preferences.Cite = { await Zotero.Styles.init(); this.styles = Zotero.Styles.getVisible() .map((style) => { + var updated = Zotero.Date.sqlToDate(style.updated, true); return { title: style.title, - updated: Zotero.Date.sqlToDate(style.updated, true).toLocaleDateString() + updated: updated ? updated.toLocaleDateString() : "" }; });