]> source.dussan.org Git - nextcloud-server.git/commitdiff
Check if value exists before returning
authorRobin Appelman <icewind@owncloud.com>
Fri, 7 Mar 2014 14:16:35 +0000 (15:16 +0100)
committerRobin Appelman <icewind@owncloud.com>
Fri, 7 Mar 2014 14:16:35 +0000 (15:16 +0100)
lib/private/files/fileinfo.php

index a9e64fe15334ae5a871ea5c522cadd4e253f9629..d6940f50bf1b61c5b1e0494163fadf498a2aaec3 100644 (file)
@@ -55,8 +55,11 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess {
        public function offsetGet($offset) {
                if ($offset === 'type') {
                        return $this->getType();
+               } elseif (isset($this->data[$offset])) {
+                       return $this->data[$offset];
+               } else {
+                       return null;
                }
-               return $this->data[$offset];
        }
 
        /**
@@ -154,7 +157,7 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess {
                }
        }
 
-       public function getData(){
+       public function getData() {
                return $this->data;
        }