]> source.dussan.org Git - nextcloud-server.git/commitdiff
Storage: don't throw warnings when a stat fails
authorRobin Appelman <icewind@owncloud.com>
Tue, 26 Feb 2013 01:53:02 +0000 (02:53 +0100)
committerRobin Appelman <icewind@owncloud.com>
Tue, 26 Feb 2013 01:53:02 +0000 (02:53 +0100)
lib/files/storage/common.php

index 0e596561920bd23c656b941250b0a050a498d8c9..cb41d17e446a12f523fd4bf40c04667d2f1e470f 100644 (file)
@@ -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) {