`$attachmentHandler` can not be null
authorCyperghost <olaf_schmitz_1@t-online.de>
Wed, 24 Jan 2024 12:56:07 +0000 (13:56 +0100)
committerCyperghost <olaf_schmitz_1@t-online.de>
Wed, 24 Jan 2024 12:56:07 +0000 (13:56 +0100)
wcfsetup/install/files/lib/acp/form/UserAddForm.class.php

index f7854adaaa3f7eabcb5678afa69248117cb5d844..b538d0459132f828e38965b7cb116eda26f9bab6 100644 (file)
@@ -128,7 +128,7 @@ class UserAddForm extends UserOptionListForm
      * @var array
      */
     public $optionTree = [];
-    public ?AttachmentHandler $attachmentHandler;
+    public AttachmentHandler $attachmentHandler;
     public int $attachmentObjectID = 0;
     public string $attachmentObjectType = 'com.woltlab.wcf.user.signature';
     public array $defaultSmilies = [];
@@ -448,14 +448,12 @@ class UserAddForm extends UserOptionListForm
      */
     public function readData()
     {
-        if ($this->attachmentObjectType) {
-            $this->attachmentHandler = new AttachmentHandler(
-                $this->attachmentObjectType,
-                $this->attachmentObjectID,
-                $this->tmpHash,
-                0
-            );
-        }
+        $this->attachmentHandler = new AttachmentHandler(
+            $this->attachmentObjectType,
+            $this->attachmentObjectID,
+            $this->tmpHash,
+            0
+        );
 
         parent::readData();
         // get default smilies