浏览代码

Do not fail hard if no appinfo is returned during update

Signed-off-by: Julius Härtl <jus@bitgrid.net>
tags/v14.0.0beta1
Julius Härtl 6 年前
父节点
当前提交
eb6e5a27a3
没有帐户链接到提交者的电子邮件
共有 2 个文件被更改,包括 5 次插入3 次删除
  1. 4
    2
      lib/private/App/AppManager.php
  2. 1
    1
      lib/private/Updater.php

+ 4
- 2
lib/private/App/AppManager.php 查看文件

@@ -358,7 +358,7 @@ class AppManager implements IAppManager {
*
* @param bool $path
* @param null $lang
* @return array app info
* @return array|null app info
*/
public function getAppInfo(string $appId, bool $path = false, $lang = null) {
if ($path) {
@@ -411,7 +411,9 @@ class AppManager implements IAppManager {
$incompatibleApps = array();
foreach ($apps as $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;
}
}

+ 1
- 1
lib/private/Updater.php 查看文件

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

正在加载...
取消
保存