summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2024-02-09 11:06:26 +0100
committerGitHub <noreply@github.com>2024-02-09 11:06:26 +0100
commit436759f317b253a4a30230509109d2f565edb959 (patch)
tree5259511d3cc2a10af98a5800c87102b6810d7b96
parent92df765457ea4fc0f2af58dee196f60a465ad297 (diff)
parent86c8584cf0e011477dfba215117c21d1dd8e3189 (diff)
downloadnextcloud-server-436759f317b253a4a30230509109d2f565edb959.tar.gz
nextcloud-server-436759f317b253a4a30230509109d2f565edb959.zip
Merge pull request #43455 from nextcloud/backport/43435/stable27
[stable27] do not break personal settings page is viewer is not there
-rw-r--r--apps/settings/lib/Settings/Personal/ServerDevNotice.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/settings/lib/Settings/Personal/ServerDevNotice.php b/apps/settings/lib/Settings/Personal/ServerDevNotice.php
index 3cb9a3a972f..3f1be7432d0 100644
--- a/apps/settings/lib/Settings/Personal/ServerDevNotice.php
+++ b/apps/settings/lib/Settings/Personal/ServerDevNotice.php
@@ -78,11 +78,11 @@ class ServerDevNotice implements ISettings {
$hasInitialState = false;
- // viewer is default enabled and this makes a zero-cost assertion for Psalm
- assert(class_exists(LoadViewer::class));
-
- // If the Reasons to use Nextcloud.pdf file is here, let's init Viewer
- if ($userFolder->nodeExists('Reasons to use Nextcloud.pdf')) {
+ // If the Reasons to use Nextcloud.pdf file is here, let's init Viewer, also check that Viewer is there
+ if (class_exists(LoadViewer::class) && $userFolder->nodeExists('Reasons to use Nextcloud.pdf')) {
+ /**
+ * @psalm-suppress UndefinedClass, InvalidArgument
+ */
$this->eventDispatcher->dispatch(LoadViewer::class, new LoadViewer());
$hasInitialState = true;
}