Skip to content

Commit

Permalink
Fixes elastic#13181 - Check values before adding them to filter
Browse files Browse the repository at this point in the history
  • Loading branch information
simianhacker committed Jul 28, 2017
1 parent 190cd5f commit 2575b8e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/core_plugins/kibana/public/dashboard/dashboard_context.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ export function dashboardContextProvider(Private, getAppState) {

if (queryBarQuery.language === 'lucene') {
// Add the query bar filter, its handled differently.
bool.must.push(luceneStringToDsl(queryBarQuery.query));
const query = luceneStringToDsl(queryBarQuery.query);
if (query) bool.must.push(query);
}

// Add each of the filter bar filters
Expand All @@ -26,10 +27,10 @@ export function dashboardContextProvider(Private, getAppState) {
if (filter.meta.disabled) return;
if (filter.meta.negate) {
bool.must_not = bool.must_not || [];
bool.must_not.push(esFilter.query || esFilter);
if (esFilter.query || esFilter) bool.must_not.push(esFilter.query || esFilter);
} else {
bool.must = bool.must || [];
bool.must.push(esFilter.query || esFilter);
if (esFilter.query || esFilter) bool.must.push(esFilter.query || esFilter);
}
});

Expand Down

0 comments on commit 2575b8e

Please sign in to comment.