12194: Handle to_tsquery(null).
authorTom Clegg <tclegg@veritasgenetics.com>
Fri, 8 Sep 2017 02:17:39 +0000 (22:17 -0400)
committerTom Clegg <tclegg@veritasgenetics.com>
Fri, 8 Sep 2017 02:17:39 +0000 (22:17 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg@veritasgenetics.com>

apps/workbench/app/assets/javascripts/to_tsquery.js

index 0192d1fdbc97dadeee7a3bfa49178188cc36b720..fc05b2675866da6304a1a58fd107e3273996dbfb 100644 (file)
@@ -16,7 +16,7 @@
 // "// "     => null
 // ""        => null
 window.to_tsquery = function(q) {
-    q = q.replace(/\W+/g, ' ').trim().replace(/ /g, ':*&')
+    q = (q || '').replace(/\W+/g, ' ').trim().replace(/ /g, ':*&')
     if (q == '')
         return null
     return q + ':*'