]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix dirInfo check when dir does not exist
authorVincent Petry <pvince81@owncloud.com>
Tue, 1 Apr 2014 13:15:03 +0000 (15:15 +0200)
committerVincent Petry <pvince81@owncloud.com>
Tue, 1 Apr 2014 13:15:03 +0000 (15:15 +0200)
apps/files/index.php

index 73601d26217b44fb00a4a7ef9be9a3b245bf4457..4d765b69e4126b67262cfefae868e6f7e753535c 100644 (file)
@@ -40,7 +40,7 @@ $dir = isset($_GET['dir']) ? stripslashes($_GET['dir']) : '';
 $dir = \OC\Files\Filesystem::normalizePath($dir);
 $dirInfo = \OC\Files\Filesystem::getFileInfo($dir);
 // Redirect if directory does not exist
-if (!$dirInfo->getType() === 'dir') {
+if (!$dirInfo || !$dirInfo->getType() === 'dir') {
        header('Location: ' . OCP\Util::getScriptName() . '');
        exit();
 }