X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=formats%2Fctf%2Fir%2Fstream-class.c;fp=formats%2Fctf%2Fir%2Fstream-class.c;h=403f5dbbf51089a5d7783b0701faeaafbd86dff7;hp=5c5db6659fe421dc16265be8cd156f464c805d7b;hb=98edd02cbad60451fbdfe07bb015005882668aec;hpb=5c424b9cbac73fe5041ed6d4859e358b64268ae9 diff --git a/formats/ctf/ir/stream-class.c b/formats/ctf/ir/stream-class.c index 5c5db665..403f5dbb 100644 --- a/formats/ctf/ir/stream-class.c +++ b/formats/ctf/ir/stream-class.c @@ -810,11 +810,13 @@ int bt_ctf_stream_class_serialize(struct bt_ctf_stream_class *stream_class, goto end; } - g_string_append(context->string, ";\n\n\tpacket.context := "); - ret = bt_ctf_field_type_serialize(stream_class->packet_context_type, - context); - if (ret) { - goto end; + if (stream_class->packet_context_type) { + g_string_append(context->string, ";\n\n\tpacket.context := "); + ret = bt_ctf_field_type_serialize(stream_class->packet_context_type, + context); + if (ret) { + goto end; + } } if (stream_class->event_context_type) {