Followup 12833, gracefully handle the getting of /

Else this breaks the app page

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2018-12-21 11:08:19 +01:00
parent a8f611093a
commit d0956c9a42
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with 7 additions and 2 deletions

View File

@ -132,8 +132,13 @@ class AppData implements IAppData {
}
}
try {
$path = $this->getAppDataFolderName() . '/' . $this->appId . '/' . $name;
$node = $this->rootFolder->get($path);
// Hardening if somebody wants to retrieve '/'
if ($name === '/') {
$node = $this->getAppDataFolder();
} else {
$path = $this->getAppDataFolderName() . '/' . $this->appId . '/' . $name;
$node = $this->rootFolder->get($path);
}
} catch (NotFoundException $e) {
$this->folders->set($key, $e);
throw $e;