From: Robin Appelman Date: Tue, 26 Feb 2013 01:53:02 +0000 (+0100) Subject: Storage: don't throw warnings when a stat fails X-Git-Tag: v5.0.0RC1~43^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=52dccd4aa14612ed93f50967e85ed6a0c6e22295;p=nextcloud-server.git Storage: don't throw warnings when a stat fails --- diff --git a/lib/files/storage/common.php b/lib/files/storage/common.php index 0e596561920..cb41d17e446 100644 --- a/lib/files/storage/common.php +++ b/lib/files/storage/common.php @@ -38,7 +38,11 @@ abstract class Common implements \OC\Files\Storage\Storage { return 0; //by definition } else { $stat = $this->stat($path); - return $stat['size']; + if (isset($stat['size'])) { + return $stat['size']; + } else { + return 0; + } } } @@ -79,7 +83,11 @@ abstract class Common implements \OC\Files\Storage\Storage { public function filemtime($path) { $stat = $this->stat($path); - return $stat['mtime']; + if (isset($stat['mtime'])) { + return $stat['mtime']; + } else { + return 0; + } } public function file_get_contents($path) {