Skip to content

Commit

Permalink
per @timroes review
Browse files Browse the repository at this point in the history
  • Loading branch information
nyurik committed Jul 2, 2018
1 parent bf16c32 commit 2b5d4a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core_plugins/vega/public/vega_view/vega_base_view.js
Expand Up @@ -235,7 +235,7 @@ export class VegaBaseView {
// in case functions don't match the list above
throw new Error(`${funcName}() is not defined for this graph`);
}
await this[handlerFunc].apply(this, args);
await this[handlerFunc](...args);
} catch (err) {
this.onError(err);
}
Expand Down Expand Up @@ -307,7 +307,7 @@ export class VegaBaseView {
// Try to parse as relative dates too (absolute dates will also be accepted)
const startDate = dateMath.parse(start);
const endDate = dateMath.parse(end);
if (!startDate.isValid() || !endDate.isValid()) {
if (!startDate || !endDate || !startDate.isValid() || !endDate.isValid()) {
throw new Error(`Error setting time filter: both time values must be either relative or absolute dates. ` +
`start=${JSON.stringify(start)}, end=${JSON.stringify(end)}`);
}
Expand Down

0 comments on commit 2b5d4a2

Please sign in to comment.