Fixed crash in ChatModel
QList::first() panics if the list is empty.
This commit is contained in:
parent
72315312d6
commit
4049d4aa7c
1 changed files with 1 additions and 1 deletions
|
@ -83,7 +83,7 @@ void ChatModel::initialize(const QVariantMap &chatInformation)
|
|||
|
||||
void ChatModel::triggerLoadMoreHistory()
|
||||
{
|
||||
if (!this->inIncrementalUpdate) {
|
||||
if (!this->inIncrementalUpdate && !messages.isEmpty()) {
|
||||
qDebug() << "[ChatModel] Trigger loading older history...";
|
||||
this->inIncrementalUpdate = true;
|
||||
this->tdLibWrapper->getChatHistory(this->chatId, this->messages.first().toMap().value("id").toLongLong());
|
||||
|
|
Loading…
Reference in a new issue