Skip to content

Commit

Permalink
Dont error when attempting to enable/disable fields that aren't in th…
Browse files Browse the repository at this point in the history
…e mapping
  • Loading branch information
Rashid Khan committed Jun 4, 2014
1 parent 6964dfd commit 0af906c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/kibana/apps/discover/controllers/discover.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,12 @@ define(function (require) {
$scope.toggleField = function (name) {
var field = _.find($scope.fields, { name: name });

// If we can't find the field in the mapping, ensure it isn't in the column list and abort
if (!field) {
$state.columns = _.without($state.columns, name);
return;
}

// toggle the display property
field.display = !field.display;

Expand Down

0 comments on commit 0af906c

Please sign in to comment.