Writer: support traces defining no packet contexts
[babeltrace.git] / formats / ctf / ir / stream-class.c
index 5c5db6659fe421dc16265be8cd156f464c805d7b..403f5dbbf51089a5d7783b0701faeaafbd86dff7 100644 (file)
@@ -810,11 +810,13 @@ int bt_ctf_stream_class_serialize(struct bt_ctf_stream_class *stream_class,
                goto end;
        }
 
                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) {
        }
 
        if (stream_class->event_context_type) {
This page took 0.022331 seconds and 4 git commands to generate.