udpsink: don't crash on NULL error

Check if there is an error before retrieving its message.

See https://bugzilla.gnome.org/show_bug.cgi?id=682481
This commit is contained in:
Wim Taymans 2012-08-22 17:23:25 +02:00
parent 42001de9ad
commit 916e4c86fa

View file

@ -790,7 +790,8 @@ join_group_failed:
{
gst_multiudpsink_stop (GST_BASE_SINK (sink));
GST_ELEMENT_ERROR (sink, RESOURCE, SETTINGS, (NULL),
("Could not join multicast group: %s", err->message));
("Could not join multicast group: %s",
err ? err->message : "unknown reason"));
g_clear_error (&err);
return FALSE;
}