diff --git a/lib/MailNotifications.php b/lib/MailNotifications.php index 208d8ea99..ef7ff2488 100644 --- a/lib/MailNotifications.php +++ b/lib/MailNotifications.php @@ -135,11 +135,13 @@ public function sendEmails(int $batchSize, int $sendTime): void { $userEnabled = $this->config->getUserValueForUsers('core', 'enabled', $userIds); $fallbackLang = $this->config->getSystemValue('force_language', null); - if ($fallbackLang === null) { - $fallbackLang = $this->config->getSystemValue('default_language', 'en'); - $userLanguages = $this->config->getUserValueForUsers('core', 'lang', $userIds); - } else { + if (is_string($fallbackLang)) { + /** @psalm-var array $userLanguages */ $userLanguages = []; + } else { + $fallbackLang = $this->config->getSystemValueString('default_language', 'en'); + /** @psalm-var array $userLanguages */ + $userLanguages = $this->config->getUserValueForUsers('core', 'lang', $userIds); } foreach ($userSettings as $settings) {