diff --git a/chrome/content/zotero/bindings/zoterosearch.xml b/chrome/content/zotero/bindings/zoterosearch.xml index dea7fc4f1..365654111 100644 --- a/chrome/content/zotero/bindings/zoterosearch.xml +++ b/chrome/content/zotero/bindings/zoterosearch.xml @@ -542,7 +542,9 @@ this.mode = condition['mode']; this.id('operatorsmenu').value = condition['operator']; - this.value = prefix + condition['value']; + this.value = prefix + + (condition.value ? condition.value : ''); + this.dontupdate = false; } diff --git a/chrome/content/zotero/xpcom/search.js b/chrome/content/zotero/xpcom/search.js index 39f46005a..51e101778 100644 --- a/chrome/content/zotero/xpcom/search.js +++ b/chrome/content/zotero/xpcom/search.js @@ -1142,7 +1142,8 @@ Zotero.Search.prototype._buildQuery = function(){ case 'isNot': // excluded with NOT IN above // Automatically cast values which might // have been stored as integers - if (condition.value.match(/^[1-9]+[0-9]*$/)) { + if (condition.value + && condition.value.match(/^[1-9]+[0-9]*$/)) { condSQL += ' LIKE ?'; } else {