diff --git a/file/lib/data/message/MessageList.class.php b/file/lib/data/message/MessageList.class.php index 76fcbed..07b6c7d 100644 --- a/file/lib/data/message/MessageList.class.php +++ b/file/lib/data/message/MessageList.class.php @@ -24,6 +24,8 @@ class MessageList extends \wcf\data\DatabaseObjectList { * @return array<\chat\data\message\Message> */ public static function getNewestMessages(\chat\data\room\Room $room, $number = CHAT_LASTMESSAGES) { + if ($number === 0) return array(); + $messageList = new static(); $messageList->sqlOrderBy = "message.messageID DESC"; $messageList->sqlLimit = $number;