From 4c9945d0fa2c19907351560dea51c5ae522c8eee Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Wed, 8 Oct 2008 04:00:59 +0000 Subject: [PATCH] BUGFIX: Reduced reliance of specific data in the system --- code/TestCategory.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/TestCategory.php b/code/TestCategory.php index af3301b..a7726e6 100644 --- a/code/TestCategory.php +++ b/code/TestCategory.php @@ -15,7 +15,9 @@ class TestCategory extends DataObject { * Returns a dropdown map of all objects of this class */ static function map() { - return DataObject::get('TestCategory')->toDropdownMap(); + $categories = DataObject::get('TestCategory'); + if($categories) return $categories->toDropdownMap(); + else return array(); } function requireDefaultRecords(){