diff --git a/lib/private/files/view.php b/lib/private/files/view.php index 3300998da3..0e0ab0dd21 100644 --- a/lib/private/files/view.php +++ b/lib/private/files/view.php @@ -76,6 +76,9 @@ class View { * @throws \Exception If $root contains an invalid path */ public function __construct($root = '') { + if (is_null($root)) { + throw new \InvalidArgumentException('Root cant be null'); + } if(!Filesystem::isValidPath($root)) { throw new \Exception(); } @@ -85,6 +88,9 @@ class View { } public function getAbsolutePath($path = '/') { + if ($path === null) { + return null; + } $this->assertPathLength($path); if ($path === '') { $path = '/';