Require an icon to be returned for the user menu item
authorAlexander Ebert <ebert@woltlab.com>
Wed, 20 Sep 2023 13:26:23 +0000 (15:26 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 20 Sep 2023 13:26:23 +0000 (15:26 +0200)
All code paths already guarantee an icon and the template unconditionally accesses the icon anyway.

wcfsetup/install/files/lib/data/user/menu/item/UserMenuItem.class.php

index 5c28ec583905fbc700d88e6145c88c35da177a15..b05df325ac272219b9f28f2f581275ae8c6cf798 100644 (file)
@@ -153,7 +153,7 @@ class UserMenuItem extends ProcessibleDatabaseObject implements ITitledObject, I
     /**
      * @since 6.0
      */
-    public function getIcon(): ?IFontAwesomeIcon
+    public function getIcon(): IFontAwesomeIcon
     {
         if ($this->iconClassName && !\str_starts_with($this->iconClassName, 'fa-')) {
             $icon = FontAwesomeIcon::fromString($this->iconClassName);