Skip to content
Snippets Groups Projects
Commit c919b420 authored by svornost's avatar svornost
Browse files

Remove falsey haystacks before searching for the needle. Prevents slaves...

Remove falsey haystacks before searching for the needle.  Prevents slaves without surnames from matching the query "name is like 0".
parent a95a08e6
No related branches found
No related tags found
No related merge requests found
......@@ -7,8 +7,8 @@ App.FindSlave = {};
* @returns {boolean}
*/
App.FindSlave._fragmentSearch = function(haystacks, needles) {
const hs = haystacks.join(" ");
return needles.every((needle) => { return needle.test(hs); });
const hs = haystacks.filter(h => !!h).join(" ");
return needles.every((needle) => needle.test(hs));
};
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment