Permalink
Browse files

Throw exception on error

  • Loading branch information...
1 parent 46e425d commit 373a471f4b124befc9ff3a91b2bd4e231e3e082c @cdujeu cdujeu committed Oct 15, 2016
Showing with 5 additions and 0 deletions.
  1. +5 −0 core/src/plugins/access.inbox/InboxAccessDriver.php
@@ -20,6 +20,7 @@
*/
namespace Pydio\Access\Driver\StreamProvider\Inbox;
+use Pydio\Access\Core\Exception\FileNotFoundException;
use Pydio\Access\Core\Model\AJXP_Node;
use Pydio\Access\Core\Filter\ContentFilter;
use Pydio\Access\Driver\StreamProvider\FS\FsAccessDriver;
@@ -98,6 +99,7 @@ public function loadRepositoryInfo(ContextInterface $ctx, &$data){
/**
* @param string $nodePath Url of a node
* @return array|mixed
+ * @throws FileNotFoundException
*/
public static function getNodeData($nodePath){
$nodeObject = new AJXP_Node($nodePath);
@@ -106,6 +108,9 @@ public static function getNodeData($nodePath){
return ['stat' => stat(ApplicationState::getTemporaryFolder())];
}
$allNodes = self::getNodes($nodeObject->getContext(), false);
+ if(!isSet($allNodes[$basename])){
+ throw new FileNotFoundException($basename);
+ }
$nodeData = $allNodes[$basename];
if(!isSet($nodeData["stat"])){
if(in_array(pathinfo($basename, PATHINFO_EXTENSION), ["error", "invitation"])){

0 comments on commit 373a471

Please sign in to comment.