lib: make packets and packet messages optional, disabled by default
[babeltrace.git] / src / plugins / ctf / fs-sink / fs-sink-stream.c
index a6f39a376b53a76a13ed84381fd3687da966e715..4ca9ce1059bd5545fd2481d5a7dbf35dadafcdc7 100644 (file)
@@ -517,10 +517,11 @@ int write_packet_context(struct fs_sink_stream *stream)
 
        /* Other members */
        if (stream->sc->packet_context_fc) {
-               const bt_field *packet_context_field =
-                       bt_packet_borrow_context_field_const(
-                               stream->packet_state.packet);
+               const bt_field *packet_context_field;
 
+               BT_ASSERT(stream->packet_state.packet);
+               packet_context_field = bt_packet_borrow_context_field_const(
+                       stream->packet_state.packet);
                BT_ASSERT(packet_context_field);
                ret = write_struct_field(stream,
                        (void *) stream->sc->packet_context_fc,
This page took 0.023961 seconds and 4 git commands to generate.