Merge pull request #43435 from nextcloud/enh/noid/do-not-break-personal-settings-without-viewer

do not break personal settings page is viewer is not there
This commit is contained in:
Simon L 2024-02-08 14:39:18 +01:00 committed by GitHub
commit ca5f7adebc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View 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;
}