srtsink: Add guard for null error when SRT open fails

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7628>
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 2caa6721f9
commit f6e8b88128

View file

@ -155,7 +155,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);
}