From 00554090d83f2b59f005a2ee681b552241866c15 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Fri, 25 Aug 2023 12:42:07 -0700 Subject: [PATCH] libsysprof: check for null node before setting toplevel --- src/libsysprof/sysprof-callgraph.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/libsysprof/sysprof-callgraph.c b/src/libsysprof/sysprof-callgraph.c index aa9f471c..e7576909 100644 --- a/src/libsysprof/sysprof-callgraph.c +++ b/src/libsysprof/sysprof-callgraph.c @@ -433,14 +433,17 @@ sysprof_callgraph_add_traceable (SysprofCallgraph *self, list_model_index, !!(self->flags & SYSPROF_CALLGRAPH_FLAGS_HIDE_SYSTEM_LIBRARIES)); - node->is_toplevel = TRUE; + if (node != NULL) + { + node->is_toplevel = TRUE; - if (node && self->augment_func) - self->augment_func (self, - node, - SYSPROF_DOCUMENT_FRAME (traceable), - TRUE, - self->augment_func_data); + if (self->augment_func) + self->augment_func (self, + node, + SYSPROF_DOCUMENT_FRAME (traceable), + TRUE, + self->augment_func_data); + } if ((self->flags & SYSPROF_CALLGRAPH_FLAGS_CATEGORIZE_FRAMES) != 0) _sysprof_callgraph_categorize (self, node);