Skip to content

Commit 0c41b0f

Browse files
committed
Fix exception on generating preview url for installed app screenshot
Some installed apps meant for older server versions might unexpectedly offer up screenshot values in a non-string format (e.g. health). Avoid an exception by checking first if the first app screenshot is indeed a string and only then trying to create the $proxyPreviewUrl Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
1 parent 75e9be5 commit 0c41b0f

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

apps/settings/lib/Controller/AppSettingsController.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,11 @@ private function fetchApps() {
245245
$apps = $appClass->listAllApps();
246246
foreach ($apps as $app) {
247247
$app['installed'] = true;
248+
$appScreenshot = $app['screenshot'][0];
248249
// locally installed apps have a flatted screenshot property
249-
if (isset($app['screenshot'][0])) {
250-
$app['screenshot'] = $this->createProxyPreviewUrl($app['screenshot'][0]);
250+
if (is_string($appScreenshot)) {
251+
$proxyPreviewUrl = $this->createProxyPreviewUrl($appScreenshot);
252+
$app['screenshot'] = $proxyPreviewUrl;
251253
}
252254
$this->allApps[$app['id']] = $app;
253255
}

0 commit comments

Comments
 (0)