Prevent infinite loop if search points to itself

This commit is contained in:
Dan Stillman 2017-07-13 18:07:58 -04:00
parent 0513cd0eef
commit ea513edf73

View file

@ -1203,6 +1203,10 @@ Zotero.Search.prototype._buildQuery = Zotero.Promise.coroutine(function* () {
id: 0
};
}
if (objectType == 'search' && obj == this) {
Zotero.warn(`Search "${this.name}" references itself -- skipping condition`);
continue;
}
if (objectType == 'collection') {
let ids = [obj.id];