summaryrefslogtreecommitdiffstats
path: root/lib/private/files/view.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/files/view.php')
-rw-r--r--lib/private/files/view.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/private/files/view.php b/lib/private/files/view.php
index 3300998da35..162bf568de7 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 can\'t 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 = '/';