Skip to content

Commit

Permalink
FIX: Edge-case bug when loading unsaved member.
Browse files Browse the repository at this point in the history
When an unsaved member was loaded, there was a code error. Now that is
fixed.
  • Loading branch information
Sam Minnee committed Dec 4, 2015
1 parent 7ad7715 commit d308fd2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion code/ApiKeyMemberExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ class ApiKeyMemberExtension extends DataExtension
];

public function updateCMSFields(FieldList $fields) {
$gridConfig = $fields->dataFieldByName('ApiKeys')->getConfig();
$grid = $fields->dataFieldByName('ApiKeys');
if(!$grid) return;

$gridConfig = $grid->getConfig();

// Simplify view
$gridConfig->removeComponentsByType('GridFieldAddExistingAutocompleter');
Expand Down

0 comments on commit d308fd2

Please sign in to comment.