aboutsummaryrefslogtreecommitdiff
path: root/main/src
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2020-04-28 23:11:08 +0200
committerfiaxh <git@lightrise.org>2020-04-28 23:11:08 +0200
commit3b6e8700b4638d15f766906794e8ddc82dd03edb (patch)
tree400a04f40545330f2e9e2e371e4eb45015ff8ea7 /main/src
parentaf52c24df7749923df897a2dd53c367a9f8ef31f (diff)
downloaddino-3b6e8700b4638d15f766906794e8ddc82dd03edb.tar.gz
dino-3b6e8700b4638d15f766906794e8ddc82dd03edb.zip
ConversationSummaryView: Fix crash when accessing content_item's first() or last() if the TreeSet is empty
Diffstat (limited to 'main/src')
-rw-r--r--main/src/ui/conversation_content_view/conversation_view.vala4
1 files changed, 2 insertions, 2 deletions
diff --git a/main/src/ui/conversation_content_view/conversation_view.vala b/main/src/ui/conversation_content_view/conversation_view.vala
index 1cf15892..dd68cef0 100644
--- a/main/src/ui/conversation_content_view/conversation_view.vala
+++ b/main/src/ui/conversation_content_view/conversation_view.vala
@@ -443,7 +443,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<ContentMetaItem> items = content_populator.populate_before(conversation, (content_items.first() as ContentMetaItem).content_item, 20);
foreach (ContentMetaItem item in items) {
do_insert_item(item);
@@ -455,7 +455,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<ContentMetaItem> items = content_populator.populate_after(conversation, (content_items.last() as ContentMetaItem).content_item, 20);
if (items.size == 0) {
at_current_content = true;