From 08cf2b1c17ce574559b0eda4735341f5432bab7b Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Wed, 12 Jul 2023 17:53:23 -0700 Subject: [PATCH] libsysprof-gtk: allow null track --- src/libsysprof-gtk/sysprof-session.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libsysprof-gtk/sysprof-session.c b/src/libsysprof-gtk/sysprof-session.c index e85932ec..b690fb54 100644 --- a/src/libsysprof-gtk/sysprof-session.c +++ b/src/libsysprof-gtk/sysprof-session.c @@ -457,11 +457,12 @@ _sysprof_session_describe (SysprofSession *self, g_autofree char *text = NULL; g_return_val_if_fail (SYSPROF_IS_SESSION (self), NULL); + g_return_val_if_fail (!track || SYSPROF_IS_TRACK (track), NULL); if (self->document == NULL) return NULL; - if ((text = _sysprof_track_format_item_for_display (track, item))) + if (track && (text = _sysprof_track_format_item_for_display (track, item))) return g_steal_pointer (&text); if (SYSPROF_IS_DOCUMENT_MARK (item))