Do not fail hard if no appinfo is returned during update

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2018-03-28 11:12:56 +02:00
parent 2124ebae72
commit eb6e5a27a3
No known key found for this signature in database
GPG Key ID: 4C614C6ED2CDE6DF
2 changed files with 5 additions and 3 deletions

View File

@ -358,7 +358,7 @@ class AppManager implements IAppManager {
* *
* @param bool $path * @param bool $path
* @param null $lang * @param null $lang
* @return array app info * @return array|null app info
*/ */
public function getAppInfo(string $appId, bool $path = false, $lang = null) { public function getAppInfo(string $appId, bool $path = false, $lang = null) {
if ($path) { if ($path) {
@ -411,7 +411,9 @@ class AppManager implements IAppManager {
$incompatibleApps = array(); $incompatibleApps = array();
foreach ($apps as $appId) { foreach ($apps as $appId) {
$info = $this->getAppInfo($appId); $info = $this->getAppInfo($appId);
if (!\OC_App::isAppCompatible($version, $info)) { if ($info === null) {
$incompatibleApps[] = ['id' => $appId];
} else if (!\OC_App::isAppCompatible($version, $info)) {
$incompatibleApps[] = $info; $incompatibleApps[] = $info;
} }
} }

View File

@ -391,7 +391,7 @@ class Updater extends BasicEmitter {
foreach ($apps as $app) { foreach ($apps as $app) {
// check if the app is compatible with this version of ownCloud // check if the app is compatible with this version of ownCloud
$info = OC_App::getAppInfo($app); $info = OC_App::getAppInfo($app);
if(!OC_App::isAppCompatible($version, $info)) { if($info === null || !OC_App::isAppCompatible($version, $info)) {
if ($appManager->isShipped($app)) { if ($appManager->isShipped($app)) {
throw new \UnexpectedValueException('The files of the app "' . $app . '" were not correctly replaced before running the update'); throw new \UnexpectedValueException('The files of the app "' . $app . '" were not correctly replaced before running the update');
} }