Commit 7f7642c8 authored by Mikaël Salson's avatar Mikaël Salson
Browse files

database.js: Prevent access to undefined value

On some browser (at least Chrome 42) this may totally fail the filter()
function which breaks the autocomplete feature.
parent 8707685b
......@@ -896,6 +896,8 @@ Database.prototype = {
if (lastValue !== value && value.length>1) {
that.list.innerHTML = options.filter(function (a) {
if (a == undefined)
return 0
return ~a.toLowerCase().indexOf(value.toLowerCase());
}).slice(0,10).map(function (a) {
return '<option value="' + value + '|' + a + '">' + a + '</option>';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment