Fixed exception in moderation queue
authorMarcel Werk <burntime@woltlab.com>
Mon, 3 Jun 2013 18:45:05 +0000 (20:45 +0200)
committerMarcel Werk <burntime@woltlab.com>
Mon, 3 Jun 2013 18:45:05 +0000 (20:45 +0200)
wcfsetup/install/files/lib/data/moderation/queue/ViewableModerationQueue.class.php

index 9c9893922c28d901fa4cac5ae96877d11ab1d41d..a48cea9d35fa5c7c656dd69aae98a0af95186d11 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 namespace wcf\data\moderation\queue;
+use wcf\data\user\User;
 use wcf\data\user\UserProfile;
 use wcf\data\DatabaseObjectDecorator;
 use wcf\data\IUserContent;
@@ -93,7 +94,12 @@ class ViewableModerationQueue extends DatabaseObjectDecorator {
         */
        public function getUserProfile() {
                if ($this->affectedObject !== null && $this->userProfile === null) {
-                       $this->userProfile = UserProfile::getUserProfile($this->affectedObject->getUserID());
+                       if ($this->affectedObject->getUserID()) {
+                               $this->userProfile = UserProfile::getUserProfile($this->affectedObject->getUserID());
+                       }
+                       else {
+                               $this->userProfile = new UserProfile(new User(null, array()));
+                       }
                }
                
                return $this->userProfile;