summaryrefslogtreecommitdiffstats
path: root/lib/private/App
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-02-17 15:25:24 +0100
committerMorris Jobke <hey@morrisjobke.de>2018-02-17 16:05:13 +0100
commit9dc3b0480228a3c35b3b7a7cb1a904006f7e0762 (patch)
treed432bd59aa7d4b87c14835b29973a0e829370e5c /lib/private/App
parentedee243b27f7d042998fd840d0b0f75548e3c489 (diff)
downloadnextcloud-server-9dc3b0480228a3c35b3b7a7cb1a904006f7e0762.tar.gz
nextcloud-server-9dc3b0480228a3c35b3b7a7cb1a904006f7e0762.zip
Fix app version to be always string and neither array nor null
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'lib/private/App')
-rw-r--r--lib/private/App/AppManager.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/private/App/AppManager.php b/lib/private/App/AppManager.php
index 0e921ba1b7f..ede1e5a7fa7 100644
--- a/lib/private/App/AppManager.php
+++ b/lib/private/App/AppManager.php
@@ -380,10 +380,10 @@ class AppManager implements IAppManager {
return $data;
}
- public function getAppVersion(string $appId, bool $useCache = true) {
+ public function getAppVersion(string $appId, bool $useCache = true): string {
if(!$useCache || !isset($this->appVersions[$appId])) {
$appInfo = \OC::$server->getAppManager()->getAppInfo($appId);
- $this->appVersions[$appId] = ($appInfo !== null) ? $appInfo['version'] : '0';
+ $this->appVersions[$appId] = ($appInfo !== null && isset($appInfo['version'])) ? $appInfo['version'] : '0';
}
return $this->appVersions[$appId];
}