mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 19:08:58 +03:00
Fix reverse iterator crash
This commit is contained in:
parent
b45f35cb51
commit
1024198228
1 changed files with 5 additions and 4 deletions
|
@ -167,11 +167,12 @@ TimelineView::addBackwardsEvents(const QString &room_id, const RoomMessages &msg
|
||||||
|
|
||||||
// Parse in reverse order to determine where we should not show sender's
|
// Parse in reverse order to determine where we should not show sender's
|
||||||
// name.
|
// name.
|
||||||
auto it = msgs.chunk().constEnd();
|
auto ii = msgs.chunk().size();
|
||||||
while (it != msgs.chunk().constBegin()) {
|
while (ii != 0) {
|
||||||
--it;
|
--ii;
|
||||||
|
|
||||||
TimelineItem *item = parseMessageEvent((*it).toObject(), TimelineDirection::Top);
|
TimelineItem *item =
|
||||||
|
parseMessageEvent(msgs.chunk().at(ii).toObject(), TimelineDirection::Top);
|
||||||
|
|
||||||
if (item != nullptr)
|
if (item != nullptr)
|
||||||
items.push_back(item);
|
items.push_back(item);
|
||||||
|
|
Loading…
Reference in a new issue