don't show exception in log if app has no Models dir
authorPhilipp Schüle <p.schuele@metaways.de>
Sat, 25 Mar 2017 17:52:43 +0000 (18:52 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Mon, 27 Mar 2017 07:48:00 +0000 (09:48 +0200)
Change-Id: I04461211c7b235340711eddcce687343751dfed0
Reviewed-on: http://gerrit.tine20.com/customers/4424
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Tinebase/Controller/Abstract.php

index 7d7a58d..bff77cc 100755 (executable)
@@ -333,8 +333,13 @@ abstract class Tinebase_Controller_Abstract extends Tinebase_Pluggable_Abstract
      */
     protected function _getModelsFromAppDir()
     {
+        $modelsDir = dirname(dirname(dirname(__FILE__))) . '/' . $this->_applicationName . '/Model/';
+        if (! file_exists($modelsDir)) {
+            return null;
+        }
+        
         try {
-            $dir = new DirectoryIterator(dirname(dirname(dirname(__FILE__))) . '/' . $this->_applicationName . '/Model/');
+            $dir = new DirectoryIterator($modelsDir);
         } catch (Exception $e) {
             Tinebase_Exception::log($e);
             return null;