Add workaround for undefined language when sending emails
authorMarcel Werk <burntime@woltlab.com>
Mon, 12 Aug 2024 09:03:43 +0000 (11:03 +0200)
committerMarcel Werk <burntime@woltlab.com>
Mon, 12 Aug 2024 09:03:43 +0000 (11:03 +0200)
The language id is saved in serialized form in the background queue. If the language was deleted between the creation of the queue entry and the processing, this resulted in an error.

wcfsetup/install/files/lib/system/email/Mailbox.class.php

index e97fd615e96026fa440d56a0f2d303dc11c0f0a0..54c421f895f94c051dd6958ba9411234ea65f819 100644 (file)
@@ -161,7 +161,9 @@ class Mailbox
      */
     public function getLanguage(): Language
     {
-        return LanguageFactory::getInstance()->getLanguage($this->languageID);
+        return
+            LanguageFactory::getInstance()->getLanguage($this->languageID)
+            ?: LanguageFactory::getInstance()->getDefaultLanguage();
     }
 
     /**