Fixes #674, Saved search referencing a deleted saved search cannot be deleted
This commit is contained in:
parent
2af5590122
commit
d5b126caf2
|
@ -883,7 +883,19 @@ Zotero.ItemGroup.prototype.getName = function()
|
|||
Zotero.ItemGroup.prototype.getChildItems = function()
|
||||
{
|
||||
var s = this.getSearchObject();
|
||||
var ids = s.search();
|
||||
try {
|
||||
var ids = s.search();
|
||||
}
|
||||
catch (e) {
|
||||
if (e.match(/Saved search [0-9]+ does not exist/)) {
|
||||
Zotero.DB.rollbackTransaction();
|
||||
Zotero.debug(e, 2);
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
throw (e);
|
||||
}
|
||||
}
|
||||
return Zotero.Items.get(ids);
|
||||
}
|
||||
|
||||
|
|
|
@ -3695,7 +3695,18 @@ Zotero.Tags = new function(){
|
|||
*/
|
||||
function getAllWithinSearch(search, types) {
|
||||
// Save search results to temporary table
|
||||
var tmpTable = search.search(true);
|
||||
try {
|
||||
var tmpTable = search.search(true);
|
||||
}
|
||||
catch (e) {
|
||||
if (e.match(/Saved search [0-9]+ does not exist/)) {
|
||||
Zotero.DB.rollbackTransaction();
|
||||
Zotero.debug(e, 2);
|
||||
}
|
||||
else {
|
||||
throw (e);
|
||||
}
|
||||
}
|
||||
if (!tmpTable) {
|
||||
return {};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user