Skip to content

Commit

Permalink
Add null checks for user and source to UI search
Browse files Browse the repository at this point in the history
  • Loading branch information
Raghav Sethi committed Oct 10, 2016
1 parent b07c228 commit 71ecf79
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions presto-main/src/main/resources/webapp/assets/query-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,20 @@ var QueryList = React.createClass({
else {
return stateFilteredQueries.filter(function(query) {
var term = searchString.toLowerCase();
return (query.queryId.toLowerCase().indexOf(term) != -1 ||
query.session.user.toLowerCase().indexOf(term) != -1 ||
query.session.source.toLowerCase().indexOf(term) != -1 ||
if (query.queryId.toLowerCase().indexOf(term) != -1 ||
query.humanReadableState.toLowerCase().indexOf(term) != -1 ||
query.query.toLowerCase().indexOf(term) != -1 );
query.query.toLowerCase().indexOf(term) != -1) {
return true;
}

if (query.session.user && query.session.user.toLowerCase().indexOf(term) != -1) {
return true;
}

if (query.session.source && query.session.source.toLowerCase().indexOf(term) != -1) {
return true;
}

}, this);
}
},
Expand Down

0 comments on commit 71ecf79

Please sign in to comment.