Merge pull request #21056 from owncloud/check-return
Verify return type
This commit is contained in:
commit
eb14c9dc1e
|
@ -1253,7 +1253,7 @@ class View {
|
||||||
* @param boolean|string $includeMountPoints true to add mountpoint sizes,
|
* @param boolean|string $includeMountPoints true to add mountpoint sizes,
|
||||||
* 'ext' to add only ext storage mount point sizes. Defaults to true.
|
* 'ext' to add only ext storage mount point sizes. Defaults to true.
|
||||||
* defaults to true
|
* defaults to true
|
||||||
* @return \OC\Files\FileInfo|bool False if file does not exist
|
* @return \OC\Files\FileInfo|false False if file does not exist
|
||||||
*/
|
*/
|
||||||
public function getFileInfo($path, $includeMountPoints = true) {
|
public function getFileInfo($path, $includeMountPoints = true) {
|
||||||
$this->assertPathLength($path);
|
$this->assertPathLength($path);
|
||||||
|
|
|
@ -1250,7 +1250,7 @@ class Preview {
|
||||||
* @param array $args
|
* @param array $args
|
||||||
* @param string $prefix
|
* @param string $prefix
|
||||||
*/
|
*/
|
||||||
public static function prepare_delete($args, $prefix = '') {
|
public static function prepare_delete(array $args, $prefix = '') {
|
||||||
$path = $args['path'];
|
$path = $args['path'];
|
||||||
if (substr($path, 0, 1) === '/') {
|
if (substr($path, 0, 1) === '/') {
|
||||||
$path = substr($path, 1);
|
$path = substr($path, 1);
|
||||||
|
@ -1259,7 +1259,11 @@ class Preview {
|
||||||
$view = new \OC\Files\View('/' . \OC_User::getUser() . '/' . $prefix);
|
$view = new \OC\Files\View('/' . \OC_User::getUser() . '/' . $prefix);
|
||||||
|
|
||||||
$absPath = Files\Filesystem::normalizePath($view->getAbsolutePath($path));
|
$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)) {
|
if ($view->is_dir($path)) {
|
||||||
$children = self::getAllChildren($view, $path);
|
$children = self::getAllChildren($view, $path);
|
||||||
self::$deleteChildrenMapper[$absPath] = $children;
|
self::$deleteChildrenMapper[$absPath] = $children;
|
||||||
|
|
Loading…
Reference in New Issue