Simplify checks
authorOlaf Braun <info@braun-development.de>
Mon, 27 Nov 2023 07:14:27 +0000 (08:14 +0100)
committerOlaf Braun <info@braun-development.de>
Mon, 27 Nov 2023 07:14:27 +0000 (08:14 +0100)
wcfsetup/install/files/lib/system/form/builder/field/user/UserFormField.class.php

index 01928f8571786ac941918adfda4970e418314345..0a2e65d765c5d63adfb9609a872ae5a0aa62d8de 100644 (file)
@@ -131,9 +131,11 @@ final class UserFormField extends AbstractFormField implements
                 } else {
                     $username = StringUtil::trim($value);
                     $user = UserProfile::getUserProfileByUsername($username);
-                    $this->users = $user !== null ? [$user] : [];
+                    if ($user !== null) {
+                        $this->users = [$user];
 
-                    $this->value = $user?->username;
+                        $this->value = $user->username;
+                    }
                 }
             }
         }