diff --git a/gst/gstthread.c b/gst/gstthread.c index e21e1855f0..4c0a836536 100644 --- a/gst/gstthread.c +++ b/gst/gstthread.c @@ -468,9 +468,12 @@ gst_thread_change_state (GstElement * element) pads = GST_ELEMENT_PADS (element); while (pads) { - GstRealPad *peer = GST_REAL_PAD (GST_PAD_PEER (pads->data)); + GstRealPad *peer = NULL; GstElement *peerelement; + if (GST_PAD_PEER (pads->data)) + peer = GST_REAL_PAD (GST_PAD_PEER (pads->data)); + pads = g_list_next (pads); if (!peer)