Skip to content

Conversation

@blizzz
Copy link
Member

@blizzz blizzz commented Feb 22, 2018

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 isAppCompatible which expects the second parameter to be an array. Restores the same behaviour as before. Without this, you are greeted with an unstyled error page.

@blizzz blizzz added this to the Nextcloud 14 milestone Feb 22, 2018
@blizzz blizzz changed the title method returns array getAppInfo has to return array Feb 22, 2018
@nickvergessen
Copy link
Member

Add : array to the method then?

null causes exceptions down the road

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
@blizzz blizzz force-pushed the fix-appinfo-return-val branch from 3b8261b to 8fbcf39 Compare February 22, 2018 13:32
@blizzz
Copy link
Member Author

blizzz commented Feb 22, 2018

added. old habits ¯_(ツ)_/¯

try {
$appPath = $this->getAppPath($appId);
} catch (AppPathNotFoundException $e) {
return null;
Copy link
Member

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:

* @return array|null

Copy link
Member

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:

if(!is_array($info)) {
throw new \Exception(
$l->t('App "%s" cannot be installed because appinfo file cannot be read.',
[$info['name']]
)
);
}

Copy link
Member

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 )

Copy link
Member Author

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.

@blizzz blizzz added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Feb 22, 2018
@blizzz
Copy link
Member Author

blizzz commented Feb 22, 2018

😕 thx. so much for a quick fix. looking later at it again.

@rullzer
Copy link
Member

rullzer commented May 23, 2018

No activity for a long time. I'll close this. Feel free to reopen if somebody picks it up.

@rullzer rullzer closed this May 23, 2018
@rullzer rullzer deleted the fix-appinfo-return-val branch May 23, 2018 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants