Skip to content

Commit

Permalink
Gotk4Gbox: Replace incorrect assertion with if check
Browse files Browse the repository at this point in the history
This silences the log message that's emitted when the assertion fails,
even though the assertion is not fatal. See #138.
  • Loading branch information
diamondburned committed Mar 25, 2024
1 parent 3fac7f7 commit 30a99fe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/core/gioutil/listmodel.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ static guint gotk4_gbox_list_get_n_items(GListModel *list) {

static gpointer gotk4_gbox_list_get_item(GListModel *list, guint index) {
Gotk4GboxList *self = GOTK4_GBOX_LIST(list);
g_return_val_if_fail(index < objects_get_size(&self->items), NULL);
if (index >= objects_get_size(&self->items)) {
return NULL;
}
return g_object_ref(objects_get(&self->items, index));
}

Expand Down

0 comments on commit 30a99fe

Please sign in to comment.