Fix dirInfo check when dir does not exist

This commit is contained in:
Vincent Petry 2014-04-01 15:15:03 +02:00
parent 27eff1ac30
commit 0bede65947
1 changed files with 1 additions and 1 deletions

View 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();
}