From 382bbdba3ce6db31795b1f239df27f5aa8b722e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Thu, 8 Mar 2012 21:30:37 +0100 Subject: [PATCH] Avoid problem with disabled join messages and no last messages. --- file/lib/page/ChatPage.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/file/lib/page/ChatPage.class.php b/file/lib/page/ChatPage.class.php index 37e7c48..302ed4a 100644 --- a/file/lib/page/ChatPage.class.php +++ b/file/lib/page/ChatPage.class.php @@ -85,7 +85,12 @@ public function readData() { } $this->newestMessages = chat\message\ChatMessageList::getNewestMessages($this->room, CHAT_LASTMESSAGES); - \wcf\util\ChatUtil::writeUserData(array('lastSeen' => end($this->newestMessages)->messageID)); + try { + \wcf\util\ChatUtil::writeUserData(array('lastSeen' => end($this->newestMessages)->messageID)); + } + catch (SystemException $e) { + \wcf\util\ChatUtil::writeUserData(array('lastSeen' => 0)); + } $this->smilies = \wcf\data\smiley\SmileyCache::getInstance()->getCategorySmilies(); $this->readChatVersion();