Merge pull request #120 from monich/chatmodel-crash

Fix crash in ChatModel
This commit is contained in:
Sebastian Wolf 2020-11-01 19:41:44 +01:00 committed by GitHub
commit 4de0cb213e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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());