Conversations that did not contain any messages for any reason could not be opened and therefore could not be left / deleted.
->add("conversation_message.messageID = ?", [$this->conversation->firstMessageID]);
$messageList->readObjects();
+ if (!\count($messageList)) {
+ return [
+ 'template' => '',
+ ];
+ }
+
return [
'template' => WCF::getTPL()->fetch('conversationMessagePreview', 'wcf', [
'message' => $messageList->getSingleObject(),
// get timeframe for modifications
$this->objectList->rewind();
- $startTime = ($this->conversation->joinedAt ?: $this->objectList->current()->time);
+ $count = \count($this->objectList);
+ $startTime = ($this->conversation->joinedAt ?: ($count ? $this->objectList->current()->time : $this->conversation->time));
$endTime = ($this->conversation->leftAt ?: TIME_NOW);
- $count = \count($this->objectList);
if ($count > 1) {
$this->objectList->seek($count - 1);
if ($this->objectList->current()->time < $this->conversation->lastPostTime) {