Fix hint alert at position 0
Change-Id: Ib15389e581fab07844256317b7d8d6cd5c4e608c
diff --git a/Changes b/Changes
index fd5a054..32d216a 100755
--- a/Changes
+++ b/Changes
@@ -5,6 +5,7 @@
- Fix VC fragments for redundant constraints.
- Modernize ES and improve variable declarations.
- Improve JS test coverage for Datepicker.
+ - Fix character errors in hint helper at position 0.
0.39 2020-10-07
- Add information on secret file to Readme.
diff --git a/dev/demo/all.html b/dev/demo/all.html
index 4ca3c6b..37d15b6 100644
--- a/dev/demo/all.html
+++ b/dev/demo/all.html
@@ -171,7 +171,9 @@
}]
}
]
-}, "query":{"wrap":{"layer":"orth","match":"match:eq","foundry":"opennlp","key":"Goethe","@type":"koral:term"},"@type":"koral:token"},"meta":{"serialQuery":"tokens:s:Goethe","startIndex":0,"version":"unknown","itemsPerPage":25,"context":"p","benchmark":"0.103553092 s","totalResults":-1}};
+ },
+ "errors":[[302,"Parantheses\/brackets unbalanced.",0]],
+ "query":{"wrap":{"layer":"orth","match":"match:eq","foundry":"opennlp","key":"Goethe","@type":"koral:term"},"@type":"koral:token"},"meta":{"serialQuery":"tokens:s:Goethe","startIndex":0,"version":"unknown","itemsPerPage":25,"context":"p","benchmark":"0.103553092 s","totalResults":-1}};
</script>
<div id="search">
diff --git a/dev/js/src/init.js b/dev/js/src/init.js
index 4b19b7e..df56b80 100644
--- a/dev/js/src/init.js
+++ b/dev/js/src/init.js
@@ -261,7 +261,7 @@
KorAP.koralQuery["errors"].forEach(function(e) {
// Malformed query
- if (e[0] === 302 && e[2]) {
+ if (e[0] === 302 && e[2] !== undefined) {
obj.hint = hintClass.create();
obj.hint.alert(e[2], e[1]);
}