diff --git a/subprojects/gst-plugins-base/gst/tcp/gsttcpclientsrc.c b/subprojects/gst-plugins-base/gst/tcp/gsttcpclientsrc.c index acb57340aa..abf2b79f4a 100644 --- a/subprojects/gst-plugins-base/gst/tcp/gsttcpclientsrc.c +++ b/subprojects/gst-plugins-base/gst/tcp/gsttcpclientsrc.c @@ -566,7 +566,8 @@ gst_tcp_client_src_get_stats (GstTCPClientSrc * src) s = gst_structure_new ("GstTCPClientSrcStats", "bytes-received", G_TYPE_UINT64, src->bytes_received, NULL); - gst_tcp_stats_from_socket (s, src->socket); + if (src->socket != NULL) + gst_tcp_stats_from_socket (s, src->socket); return s; } diff --git a/subprojects/gst-plugins-base/gst/tcp/gsttcpserversrc.c b/subprojects/gst-plugins-base/gst/tcp/gsttcpserversrc.c index 2e3403bdd7..cc76ffebbc 100644 --- a/subprojects/gst-plugins-base/gst/tcp/gsttcpserversrc.c +++ b/subprojects/gst-plugins-base/gst/tcp/gsttcpserversrc.c @@ -596,7 +596,8 @@ gst_tcp_server_src_get_stats (GstTCPServerSrc * src) s = gst_structure_new ("GstTCPServerSrcStats", "bytes-received", G_TYPE_UINT64, src->bytes_received, NULL); - gst_tcp_stats_from_socket (s, src->client_socket); + if (src->client_socket != NULL) + gst_tcp_stats_from_socket (s, src->client_socket); return s; }