Check if value exists before returning

This commit is contained in:
Robin Appelman 2014-03-07 15:16:35 +01:00
parent 65f52fee4f
commit 51165a1a04
1 changed files with 5 additions and 2 deletions

View 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;
}