Skip to content

Commit 1766bff

Browse files
authoredAug 21, 2024··

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed
 

‎lib/private/Repair/RepairLogoDimension.php

+14-3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
namespace OC\Repair;
1010

1111
use OCA\Theming\ImageManager;
12+
use OCP\Files\NotFoundException;
13+
use OCP\Files\NotPermittedException;
1214
use OCP\IConfig;
1315
use OCP\Migration\IOutput;
1416
use OCP\Migration\IRepairStep;
@@ -44,9 +46,18 @@ public function run(IOutput $output): void {
4446
return;
4547
}
4648

47-
$simpleFile = $imageManager->getImage('logo', false);
48-
49-
$image = @imagecreatefromstring($simpleFile->getContent());
49+
try {
50+
try {
51+
$simpleFile = $imageManager->getImage('logo', false);
52+
$image = @imagecreatefromstring($simpleFile->getContent());
53+
} catch (NotFoundException|NotPermittedException) {
54+
$simpleFile = $imageManager->getImage('logo');
55+
$image = false;
56+
}
57+
} catch (NotFoundException|NotPermittedException) {
58+
$output->info('Theming is not used to provide a logo');
59+
return;
60+
}
5061

5162
$dimensions = '';
5263
if ($image !== false) {

0 commit comments

Comments
 (0)
Please sign in to comment.