fix getThreadMessagesByParentId

This commit is contained in:
Salvatore Giordano
2021-03-12 15:07:47 +01:00
parent 9952265109
commit eaaa5c9962
@@ -102,7 +102,7 @@ class MessageDao extends DatabaseAccessor<MoorChatDatabase>
.map(_messageFromJoinRow)
.get());
if (options?.lessThan != null) {
if (options?.lessThan != null && msgList.isNotEmpty) {
final lessThanIndex = msgList.indexWhere((m) => m.id == options.lessThan);
msgList.removeRange(lessThanIndex, msgList.length);
}