Adding a check for aggConfig and aggConfig.aggType

This commit is contained in:
Chris Cowan 2014-09-18 10:17:49 -07:00
parent f721f419c1
commit 834a0bbab5

View file

@ -146,7 +146,9 @@ define(function (require) {
if (!vis.listeners) vis.listeners = {};
vis.listeners.click = function (e) {
if (e.aggConfig.aggType.name === 'terms') {
// This code is only inplace for the beta release this will all get refactored
// after we get the release out.
if (e.aggConfig && e.aggConfig.aggType && e.aggConfig.aggType.name === 'terms') {
var filter;
var filters = _.flatten([$state.filters || []], true);
var previous = _.find(filters, function (item) {