summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorPhilipp Unger <philipp.unger.1988@gmail.com>2024-11-25 22:27:45 +0100
committerMatthew Fennell <matthew@fennell.dev>2025-12-27 14:21:18 +0000
commitf71f180da9cf61d3c47085326651193195d2de64 (patch)
treee84ef1d3414d57218485d3d50414957141603422 /src/gui
parent43a9dc8e96557bef4a919e517a9355ef0b3a4843 (diff)
[PATCH] omni-area: check for n_messages greater zero to avoid divide by zero
fixes #496 Forwarded: https://gitlab.gnome.org/World/Endeavour/-/issues/496 Gbp-Pq: Name omni-area-check-for-n_messages-greater-zero-to-avoid.patch
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/gtd-omni-area.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/gtd-omni-area.c b/src/gui/gtd-omni-area.c
index 828f36c..007061b 100644
--- a/src/gui/gtd-omni-area.c
+++ b/src/gui/gtd-omni-area.c
@@ -78,7 +78,7 @@ switch_message_cb (gpointer user_data)
n_messages = g_queue_get_length (self->messages);
gtk_stack_set_visible_child_name (self->main_stack, n_messages > 0 ? "messages" : "placeholder");
- next_message_index = (self->current + 1) % n_messages;
+ next_message_index = n_messages > 0 ? (self->current + 1) % n_messages : 0;
show_message (self, next_message_index);
return G_SOURCE_CONTINUE;