diff options
author | Andrés G. Aragoneses <knocte@gmail.com> | 2013-10-12 19:10:32 +0200 |
---|---|---|
committer | Stephan Sundermann <stephansundermann@gmail.com> | 2013-12-21 16:52:25 +0100 |
commit | 6b297b921f9aafe2f1b5583f483fbd51c720883a (patch) | |
tree | 4af52a2ab441d91a479b21c092b2a8eeaed1673d /sources | |
parent | 2bd2b1d7af44d94125189ff6e4b165e318f99919 (diff) |
Gst.Object: add some pre-validation to property setter
Diffstat (limited to 'sources')
-rw-r--r-- | sources/custom/Object.cs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sources/custom/Object.cs b/sources/custom/Object.cs index 283d41b..97a37dd 100644 --- a/sources/custom/Object.cs +++ b/sources/custom/Object.cs @@ -53,6 +53,14 @@ namespace Gst { throw new PropertyNotFoundException (); } set { if (PropertyExists (property)) { + if (value == null) { + throw new ArgumentNullException (); + } + var type = value.GetType (); + var gtype = (GLib.GType)type; + if (gtype == null) { + throw new Exception ("Could not find a GType for type " + type.FullName); + } using (GLib.Value v = new GLib.Value ((GLib.GType)value.GetType ())) { v.Val = value; SetProperty (property, v); |