Fix advanced search test failure after 13d55910e

This commit is contained in:
Dan Stillman 2018-12-17 05:36:14 -05:00
parent e82283494b
commit 7594fe1800

View file

@ -828,10 +828,9 @@ Zotero.Search.prototype.search = Zotero.Promise.coroutine(function* (asTempTable
* If this object is identified (has an id or library/key), loadAll() must have been called.
*/
Zotero.Search.prototype.fromJSON = function (json) {
if (!json.name) {
throw new Error("'name' property not provided for search");
if (json.name) {
this.name = json.name;
}
this.name = json.name;
Object.keys(this.getConditions()).forEach(id => this.removeCondition(id));
for (let i = 0; i < json.conditions.length; i++) {