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) {