Make sure that every second parameter to Structure.Add(...) is a string
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Mon, 20 Apr 2009 18:53:01 +0000 (20:53 +0200)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Mon, 20 Apr 2009 18:53:01 +0000 (20:53 +0200)
gstreamer-sharp/Structure.custom

index a773b304ab0094b36657bdf143ddf55b60c33140..ad635592bc6a2f63c618eefa4c622b12d8424c5c 100644 (file)
@@ -168,6 +168,9 @@ public void Set (params object[] fields) {
     throw new ArgumentException ();
 
   for (i = 0; i < length; i += 2) {
+    if (fields[i].GetType () != typeof (string))
+      throw new ArgumentException ();
+
     SetValue (fields[i] as string, new GLib.Value (fields[i+1]));
   }
 }