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

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