From 188526a9de192220e40946def4c61d1d902cacdb Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Thu, 16 Aug 2007 06:36:24 +0000 Subject: [PATCH] Removed notice-level errors git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@40232 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- security/Security.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/security/Security.php b/security/Security.php index 5d28ff501..2b06de2de 100644 --- a/security/Security.php +++ b/security/Security.php @@ -195,7 +195,9 @@ class Security extends Controller { */ static function findAnAdministrator($username = 'admin', $password = 'password') { $permission = DataObject::get_one("Permission", "`Code` = 'ADMIN'"); - $adminGroup = DataObject::get_one("Group", "`ID` = '{$permission->GroupID}'", true, "ID"); + + $adminGroup = null; + if($permission) $adminGroup = DataObject::get_one("Group", "`ID` = '{$permission->GroupID}'", true, "ID"); if($adminGroup) { if($adminGroup->Members()->First()) {