+ if (!session->current_trace_chunk) {
+ /*
+ * Means the session is being destroyed. React the same way
+ * as if it could not be found at all.
+ */
+ DBG("Relay session %" PRIu64 " has no current trace chunk, replying LTTNG_VIEWER_NEW_STREAMS_ERR",
+ session_id);
+ response.status = htobe32(LTTNG_VIEWER_NEW_STREAMS_ERR);
+ goto send_reply_unlock;
+ }
+