Check if value exists before returning
This commit is contained in:
parent
65f52fee4f
commit
51165a1a04
1 changed files with 5 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue