From 444d6d31375c228d3679e99a8df0478ae02d0a89 Mon Sep 17 00:00:00 2001 From: Tom Rix Date: Mon, 29 Mar 2010 03:11:15 +0000 Subject: [PATCH] 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 --- security/Member.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/security/Member.php b/security/Member.php index 5ecaf0539..f94f98da0 100755 --- a/security/Member.php +++ b/security/Member.php @@ -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()).