Prevent possible error if schema check occurs before schema update

Not sure if this can happen, but if there's any way for the schema
integrity check to run before the global schema is updated, use -1 for
the annotation itemTypeID.
This commit is contained in:
Dan Stillman 2021-02-22 03:22:52 -05:00
parent 2d2062a63d
commit db0bd56688

View file

@ -1799,9 +1799,9 @@ Zotero.Schema = new function(){
var noteID = parseInt(yield Zotero.DB.valueQueryAsync(
"SELECT itemTypeID FROM itemTypes WHERE typeName='note'"
));
var annotationID = parseInt(yield Zotero.DB.valueQueryAsync(
var annotationID = parseInt((yield Zotero.DB.valueQueryAsync(
"SELECT itemTypeID FROM itemTypes WHERE typeName='annotation'"
));
)) || -1);
// The first position is for testing and the second is for repairing. Can be either SQL
// statements or promise-returning functions. For statements, the repair entry can be either