]> source.dussan.org Git - nextcloud-server.git/commitdiff
do not break personal settings page is viewer is not there 43476/head
authorSimon L <szaimen@e.mail.de>
Fri, 9 Feb 2024 11:28:06 +0000 (12:28 +0100)
committerSimon L <szaimen@e.mail.de>
Fri, 9 Feb 2024 11:28:06 +0000 (12:28 +0100)
Signed-off-by: Simon L <szaimen@e.mail.de>
apps/settings/lib/Settings/Personal/ServerDevNotice.php

index 8d6b07431270f0373b7df0bcb63b2d2acbfbf6c3..8ff68b4063f84cf579df90647e65821ad1ed4432 100644 (file)
@@ -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;
                }