srtsink: Add guard for null error when SRT open fails

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7688>
This commit is contained in:
Francisco Javier Velázquez-García 2024-10-09 12:32:34 -04:00 committed by GStreamer Marge Bot
parent 771e73c2d5
commit 28c18b5390

View file

@ -158,7 +158,7 @@ gst_srt_sink_start (GstBaseSink * bsink)
if (!ret) {
/* ensure error is posted since state change will fail */
GST_ELEMENT_ERROR (self, RESOURCE, OPEN_WRITE, (NULL),
("Failed to open SRT: %s", error->message));
("Failed to open SRT: %s", error ? error->message : "Unknown error"));
g_clear_error (&error);
}