diff --git a/file/lib/page/ChatPage.class.php b/file/lib/page/ChatPage.class.php index 9656430..7c21fbd 100644 --- a/file/lib/page/ChatPage.class.php +++ b/file/lib/page/ChatPage.class.php @@ -67,7 +67,7 @@ public function readData() { $this->userData['color'] = \wcf\util\ChatUtil::readUserData('color'); \wcf\util\ChatUtil::writeUserData(array('roomID' => $this->room->roomID)); $this->newestMessages = chat\message\ChatMessageList::getNewestMessages($this->room, CHAT_LASTMESSAGES); - \wcf\util\ChatUtil::writeUserData(array('lastSeen' => end($this->newestMessages)->messageID)); + \wcf\util\ChatUtil::writeUserData(array('lastSeen' => count($this->newestMessages) ? end($this->newestMessages)->messageID : 0)); if (CHAT_DISPLAY_JOIN_LEAVE) { $messageAction = new chat\message\ChatMessageAction(array(), 'create', array(