-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
getAppInfo has to return array #8503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Add |
null causes exceptions down the road Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
3b8261b to
8fbcf39
Compare
|
added. old habits ¯_(ツ)_/¯ |
| try { | ||
| $appPath = $this->getAppPath($appId); | ||
| } catch (AppPathNotFoundException $e) { | ||
| return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the old OCP has null documented:
Line 76 in 6d3c8d5
| * @return array|null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And it's also expected in some places:
server/lib/private/Installer.php
Lines 107 to 113 in 9dc3b04
| if(!is_array($info)) { | |
| throw new \Exception( | |
| $l->t('App "%s" cannot be installed because appinfo file cannot be read.', | |
| [$info['name']] | |
| ) | |
| ); | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check if not array and immediately use as array. Goood )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already fixed in https://github.com/nextcloud/server/pull/8504… but could use a backport.
|
😕 thx. so much for a quick fix. looking later at it again. |
|
No activity for a long time. I'll close this. Feel free to reopen if somebody picks it up. |
null causes exceptions down the road (e.g. when you uncleanly remove an app only from the file system) in AppManager::getIncompatibleApps()::405, the call to
isAppCompatiblewhich expects the second parameter to be an array. Restores the same behaviour as before. Without this, you are greeted with an unstyled error page.