Merge pull request #22650 from nextcloud/fix/noid/fix-psalm-warning

Only load viewer in settings if the viewer app is enabled
This commit is contained in:
Morris Jobke 2020-09-07 20:41:49 +02:00 committed by GitHub
commit 0e6344f543
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -78,6 +78,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());