Commits

Frank Bennett committed 2a91f69

Generate citation cluster output in a try/catch when previewing, to avoid a crash that would leave the registry in an inconsistent state.

Comments (0)

Files changed (1)

 		}
 		//SNIP-END
 	}
+
 	this.tmp.taintedItemIDs = {};
 	this.tmp.taintedCitationIDs = {};
 	var sortedItems = [];
 			}
 		}
 	}
+
 	var ret = [];
 	if (flag === CSL.PREVIEW) {
 		// If previewing, return only a rendered string
 			CSL.debug("****** start run processor *********");
 		}
 		//SNIP-END
-		ret = this.process_CitationCluster.call(this, citation.sortedItems, citation.citationID);
-
+		try {
+			ret = this.process_CitationCluster.call(this, citation.sortedItems, citation.citationID);
+		} catch (e) {
+			CSL.error("Error running CSL processor for preview");
+		}
+			
 		//SNIP-START
 		if (this.debug) {
 			CSL.debug("****** end run processor *********");