Skip to content

Commit

Permalink
making sure type is defined and has postFlightRequest function (#17809)
Browse files Browse the repository at this point in the history
  • Loading branch information
ppisljar authored Apr 20, 2018
1 parent 98f1220 commit 6068dce
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/ui/public/vis/request_handlers/courier.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,10 @@ const CourierRequestHandlerProvider = function (Private, courier, timefilter) {
return _.cloneDeep(resp);
}).then(async resp => {
for (const agg of vis.getAggConfig()) {
const nestedSearchSource = new SearchSource().inherits(requestSearchSource);
resp = await agg.type.postFlightRequest(resp, vis.aggs, agg, nestedSearchSource);
if (_.has(agg, 'type.postFlightRequest')) {
const nestedSearchSource = new SearchSource().inherits(requestSearchSource);
resp = await agg.type.postFlightRequest(resp, vis.aggs, agg, nestedSearchSource);
}
}

searchSource.finalResponse = resp;
Expand Down

0 comments on commit 6068dce

Please sign in to comment.