Index: gstbin.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstbin.c,v
retrieving revision 1.149.4.2
diff -u -u -r1.149.4.2 gstbin.c
--- gstbin.c	7 Jun 2003 22:36:35 -0000	1.149.4.2
+++ gstbin.c	21 Aug 2003 08:38:14 -0000
@@ -357,13 +357,14 @@
 
       /* if the peer element exists and is a candidate */
       if (GST_PAD_PEER (pad)) {
-        if (gst_pad_get_scheduler (GST_PAD_PEER (pad)) == sched) {
+        if (sched && gst_pad_get_scheduler (GST_PAD_PEER (pad)) == sched) {
           GST_INFO (GST_CAT_SCHEDULING, "peer is in same scheduler, telling scheduler");
 
-          if (GST_PAD_IS_SRC (pad))
+          if (GST_PAD_IS_SRC (pad)){
             gst_scheduler_pad_unlink (sched, pad, GST_PAD_PEER (pad));
-          else
+	  }else{
             gst_scheduler_pad_unlink (sched, GST_PAD_PEER (pad), pad);
+	  }
         }
       }
     }
