0011780: avoid PHP Fatal if node is missing
authorCornelius Weiß <c.weiss@metaways.de>
Mon, 11 Apr 2016 17:04:13 +0000 (19:04 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Tue, 19 Apr 2016 15:36:01 +0000 (17:36 +0200)
Change-Id: I6fc412c5ad732ea2a32f1c2815536e128407d729
Reviewed-on: http://gerrit.tine20.com/customers/3041
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Tinebase/Frontend/WebDAV/Node.php

index 20e4617..7658aee 100644 (file)
@@ -34,16 +34,18 @@ abstract class Tinebase_Frontend_WebDAV_Node implements Sabre\DAV\INode
     
     public function __construct($_path) 
     {
+        $this->_path      = $_path;
+
         if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) 
             Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' filesystem path: ' . $_path);
         
         try {
             $this->_node = Tinebase_FileSystem::getInstance()->stat($_path);
-        } catch (Tinebase_Exception_NotFound $tenf) {
+        } catch (Tinebase_Exception_NotFound $tenf) {}
+        
+        if (! $this->_node) {
             throw new Sabre\DAV\Exception\NotFound('Filesystem path: ' . $_path . ' not found');
         }
-        
-        $this->_path      = $_path;
     }
     
     public function getId()