summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-11-06 00:40:39 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2021-11-06 00:40:39 +0100
commitd112d6b11fe0ad49835c2e31d132364333b94dc3 (patch)
treef4182fe9a06d772105263e35157e604986f76abb
parentFix leave room dialog (diff)
downloadnheko-d112d6b11fe0ad49835c2e31d132364333b94dc3.tar.xz
Fix crash when clearing empty timeline
-rw-r--r--src/Cache.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Cache.cpp b/src/Cache.cpp

index 58eb2630..b2db9edd 100644 --- a/src/Cache.cpp +++ b/src/Cache.cpp
@@ -3182,9 +3182,11 @@ Cache::clearTimeline(const std::string &room_id) break; } - do { - lmdb::cursor_del(msgCursor); - } while (msgCursor.get(indexVal, val, MDB_PREV)); + if (!start) { + do { + lmdb::cursor_del(msgCursor); + } while (msgCursor.get(indexVal, val, MDB_PREV)); + } cursor.close(); msgCursor.close();