From 9a789637d81f05949e46c5ad87fd157e66561d77 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Tue, 28 Apr 2020 23:11:08 +0200 Subject: [PATCH] ConversationSummaryView: Fix crash when accessing content_item's first() or last() if the TreeSet is empty --- main/src/ui/conversation_summary/conversation_view.vala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main/src/ui/conversation_summary/conversation_view.vala b/main/src/ui/conversation_summary/conversation_view.vala index 4cde3668..fa2011fa 100644 --- a/main/src/ui/conversation_summary/conversation_view.vala +++ b/main/src/ui/conversation_summary/conversation_view.vala @@ -317,7 +317,7 @@ public class ConversationView : Box, Plugins.ConversationItemCollection, Plugins private void load_earlier_messages() { was_value = scrolled.vadjustment.value; if (!reloading_mutex.trylock()) return; - if (meta_items.size > 0) { + if (content_items.size > 0) { Gee.List items = content_populator.populate_before(conversation, (content_items.first() as ContentMetaItem).content_item, 20); foreach (ContentMetaItem item in items) { do_insert_item(item); @@ -329,7 +329,7 @@ public class ConversationView : Box, Plugins.ConversationItemCollection, Plugins private void load_later_messages() { if (!reloading_mutex.trylock()) return; - if (meta_items.size > 0 && !at_current_content) { + if (content_items.size > 0 && !at_current_content) { Gee.List items = content_populator.populate_after(conversation, (content_items.last() as ContentMetaItem).content_item, 20); if (items.size == 0) { at_current_content = true;