add try catch block in admin.demodata
authorAlexander Stintzing <a.stintzing@metaways.de>
Mon, 28 Apr 2014 10:40:44 +0000 (12:40 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Mon, 28 Apr 2014 15:14:14 +0000 (17:14 +0200)
if there is no testConfig, an exception is thrown.
catch this and use default

Change-Id: Ic494d363d465a7473442ad3ad4eeab503ae91505
Reviewed-on: http://gerrit.tine20.com/customers/566
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Admin/Setup/DemoData.php

index 9f24a3b..45d33c5 100644 (file)
@@ -173,7 +173,11 @@ class Admin_Setup_DemoData extends Tinebase_Setup_DemoData_Abstract
                 $groupId = $group->getId();
                 
                 // TODO think about fetching this from IMAP config
-                $testconfig = Zend_Registry::get('testConfig');
+                try {
+                    $testconfig = Zend_Registry::get('testConfig');
+                } catch (Zend_Exception $e) {
+                    $testconfig = NULL;
+                }
                 $emailDomain = ($testconfig && isset($testconfig->maildomain)) ? $testconfig->maildomain : 'tine20.org';
 
                 $user = new Tinebase_Model_FullUser(array(