diff options
author | Robin Appelman <icewind@owncloud.com> | 2014-03-07 15:16:35 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2014-03-07 15:16:35 +0100 |
commit | 51165a1a04a8a97a5d7ac684b0588a86c01a0018 (patch) | |
tree | 5cf43041499c26d655455eeb3ec28c2a9b94a94e /lib/private/files/fileinfo.php | |
parent | 65f52fee4f333cc31591a265c2d5b4c0ed0d7016 (diff) | |
download | nextcloud-server-51165a1a04a8a97a5d7ac684b0588a86c01a0018.tar.gz nextcloud-server-51165a1a04a8a97a5d7ac684b0588a86c01a0018.zip |
Check if value exists before returning
Diffstat (limited to 'lib/private/files/fileinfo.php')
-rw-r--r-- | lib/private/files/fileinfo.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/private/files/fileinfo.php b/lib/private/files/fileinfo.php index a9e64fe1533..d6940f50bf1 100644 --- a/lib/private/files/fileinfo.php +++ b/lib/private/files/fileinfo.php @@ -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; } |