Skip to content

Commit 0b1396d

Browse files
authored
Merge pull request #43476 from nextcloud/enh/noid/personal-settings-2
re-do not break personal settings page is viewer is not there
2 parents be049ba + 9228adb commit 0b1396d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

apps/settings/lib/Settings/Personal/ServerDevNotice.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ public function getForm(): TemplateResponse {
7878

7979
$hasInitialState = false;
8080

81-
// viewer is default enabled and this makes a zero-cost assertion for Psalm
82-
assert(class_exists(LoadViewer::class));
83-
84-
// If the Reasons to use Nextcloud.pdf file is here, let's init Viewer
85-
if ($userFolder->nodeExists('Reasons to use Nextcloud.pdf')) {
81+
// If the Reasons to use Nextcloud.pdf file is here, let's init Viewer, also check that Viewer is there
82+
if (class_exists(LoadViewer::class) && $userFolder->nodeExists('Reasons to use Nextcloud.pdf')) {
83+
/**
84+
* @psalm-suppress UndefinedClass, InvalidArgument
85+
*/
8686
$this->eventDispatcher->dispatch(LoadViewer::class, new LoadViewer());
8787
$hasInitialState = true;
8888
}

0 commit comments

Comments
 (0)