Fix crash when search uses no-op condition and includeParentsAndChildren

E.g., a nonexistent saved search
This commit is contained in:
Dan Stillman 2020-02-11 00:22:00 -05:00
parent 9e2ea008f4
commit 76081ab05f
2 changed files with 21 additions and 0 deletions

View file

@ -409,6 +409,19 @@ describe("Zotero.Search", function() {
});
});
describe("includeParentsAndChildren", function () {
it("should handle ANY search with no-op condition", async function () {
var s = new Zotero.Search();
s.libraryID = userLibraryID;
s.name = "Test";
s.addCondition('joinMode', 'any');
s.addCondition('savedSearch', 'is', Zotero.Utilities.randomString());
s.addCondition('includeParentsAndChildren', 'true');
var matches = await s.search();
assert.lengthOf(matches, 0);
});
});
describe("key", function () {
it("should allow more than max bound parameters", function* () {
let s = new Zotero.Search();