From ce1e873a0a16cb756c5edfdbd4488b7f6cf9bbb7 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Mon, 7 Sep 2020 18:02:57 +0200 Subject: [PATCH] Only load viewer in settings if the viewer app is enabled Signed-off-by: Morris Jobke --- apps/settings/lib/Settings/Personal/ServerDevNotice.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/settings/lib/Settings/Personal/ServerDevNotice.php b/apps/settings/lib/Settings/Personal/ServerDevNotice.php index 58314691021..d814fbb9e4a 100644 --- a/apps/settings/lib/Settings/Personal/ServerDevNotice.php +++ b/apps/settings/lib/Settings/Personal/ServerDevNotice.php @@ -77,6 +77,9 @@ 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')) { $this->eventDispatcher->dispatch(LoadViewer::class, new LoadViewer()); -- 2.39.5