summaryrefslogtreecommitdiffstats
path: root/lib/private/preview.php
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-12-09 07:32:19 +0100
committerLukas Reschke <lukas@owncloud.com>2015-12-09 07:32:19 +0100
commit61da3d530d489525fc0a6dd9575dc9ab37f1bc44 (patch)
treed547ad08924378cfbf492a3ef56be21ba00754a5 /lib/private/preview.php
parent13993c4a6db83c0a637fc7c20da0470acae47208 (diff)
downloadnextcloud-server-61da3d530d489525fc0a6dd9575dc9ab37f1bc44.tar.gz
nextcloud-server-61da3d530d489525fc0a6dd9575dc9ab37f1bc44.zip
Verify return type
Can also be null. Silences another security warning...
Diffstat (limited to 'lib/private/preview.php')
-rw-r--r--lib/private/preview.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/private/preview.php b/lib/private/preview.php
index b2accdfd00f..38c043030fc 100644
--- a/lib/private/preview.php
+++ b/lib/private/preview.php
@@ -1250,7 +1250,7 @@ class Preview {
* @param array $args
* @param string $prefix
*/
- public static function prepare_delete($args, $prefix = '') {
+ public static function prepare_delete(array $args, $prefix = '') {
$path = $args['path'];
if (substr($path, 0, 1) === '/') {
$path = substr($path, 1);
@@ -1259,7 +1259,11 @@ class Preview {
$view = new \OC\Files\View('/' . \OC_User::getUser() . '/' . $prefix);
$absPath = Files\Filesystem::normalizePath($view->getAbsolutePath($path));
- self::addPathToDeleteFileMapper($absPath, $view->getFileInfo($path));
+ $fileInfo = $view->getFileInfo($path);
+ if($fileInfo === false) {
+ return;
+ }
+ self::addPathToDeleteFileMapper($absPath, $fileInfo);
if ($view->is_dir($path)) {
$children = self::getAllChildren($view, $path);
self::$deleteChildrenMapper[$absPath] = $children;