libsysprof-gtk: return NULL unless subtracks are non-empty

These don't really change at runtime, so we can employ this to bridge
things to GtkTreeListModel well.
This commit is contained in:
Christian Hergert
2023-06-29 15:11:02 -07:00
parent b340371055
commit 2f25fd31fe

View File

@ -192,6 +192,9 @@ sysprof_track_list_subtracks (SysprofTrack *self)
g_return_val_if_fail (SYSPROF_IS_TRACK (self), NULL);
if (g_list_model_get_n_items (G_LIST_MODEL (priv->subtracks)) == 0)
return NULL;
return g_object_ref (G_LIST_MODEL (priv->subtracks));
}