This function is called indirectly when calling __repr__ (print) in the
python bindings on the definition object returned by the
get_top_level_scope method thus resulting in a segmentation fault when
the name attribute is not set.
Fixes #373
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
const char *bt_ctf_field_name(const struct definition *def)
{
const char *bt_ctf_field_name(const struct definition *def)
{
+ if (!def || !def->name)
return NULL;
return rem_(g_quark_to_string(def->name));
return NULL;
return rem_(g_quark_to_string(def->name));