From 51165a1a04a8a97a5d7ac684b0588a86c01a0018 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 7 Mar 2014 15:16:35 +0100 Subject: [PATCH] Check if value exists before returning --- lib/private/files/fileinfo.php | 7 +++++-- 1 file 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; }