dashdemux: Fix potential NULL pointer dereference

CID 1399700
diff --git a/ext/dash/gstdashdemux.c b/ext/dash/gstdashdemux.c
index 756983c..2f34148 100644
--- a/ext/dash/gstdashdemux.c
+++ b/ext/dash/gstdashdemux.c
@@ -1176,8 +1176,13 @@
         }
       }
       g_free (dashstream->last_representation_id);
-      dashstream->last_representation_id =
-          g_strdup (dashstream->active_stream->cur_representation->id);
+      if (dashstream->active_stream
+          && dashstream->active_stream->cur_representation) {
+        dashstream->last_representation_id =
+            g_strdup (dashstream->active_stream->cur_representation->id);
+      } else {
+        dashstream->last_representation_id = NULL;
+      }
     }
 
     if (GST_ADAPTIVE_DEMUX_STREAM_NEED_HEADER (stream)) {