throw exception if node container is missing
authorPhilipp Schüle <p.schuele@metaways.de>
Tue, 8 Oct 2013 08:26:05 +0000 (10:26 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Tue, 8 Oct 2013 12:16:37 +0000 (14:16 +0200)
Change-Id: I45750549aed64fd8d087efe980c294b5140882c7
Reviewed-on: http://gerrit.tine20.com/customers/158
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
Tested-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Filemanager/Controller/Node.php

index b6cbee7..d261c78 100644 (file)
@@ -1156,6 +1156,7 @@ class Filemanager_Controller_Node extends Tinebase_Controller_Record_Abstract
      * 
      * @param string $_flatpath
      * @return boolean
+     * @throws Tinebase_Exception_NotFound
      */
     protected function _deleteNode($_flatpath)
     {
@@ -1173,6 +1174,11 @@ class Filemanager_Controller_Node extends Tinebase_Controller_Record_Abstract
         $success = $this->_deleteNodeInBackend($pathRecord);
         
         if ($success && ! $parentPathRecord->container) {
+            
+            if (! is_object($pathRecord->container)) {
+                throw new Tinebase_Exception_NotFound('Container not found');
+            }
+            
             if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ 
                 . ' Delete container ' . $pathRecord->container->name);
             Tinebase_Container::getInstance()->delete($pathRecord->container->getId());