BUGFIX avoid call to non-object

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@101794 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Tom Rix 2010-03-29 03:11:15 +00:00 committed by Sam Minnee
parent 9bb41119e7
commit 444d6d3137

View File

@ -121,13 +121,11 @@ class Member extends DataObject {
// Find or create ADMIN group
$adminGroups = Permission::get_groups_by_permission('ADMIN');
if($adminGroups) {
if(!$adminGroups) {
singleton('Group')->requireDefaultRecords();
$adminGroups = Permission::get_groups_by_permission('ADMIN');
$adminGroup = $adminGroups->First();
} else {
$adminGroup = $adminGroups->First();
}
$adminGroup = $adminGroups->First();
// Add a default administrator to the first ADMIN group found (most likely the default
// group created through Group->requireDefaultRecords()).