path: root/src/bindings
diff options
authorLauro Moura <lauromoura@expertisesolutions.com.br>2019-04-09 16:23:03 -0300
committerVitor Sousa <vitorsousa@expertisesolutions.com.br>2019-04-09 16:26:50 -0300
commite7e1d777f1107940164246a9e3e5921ba37eb8cf (patch)
tree0f94887701a063e56abdb0766e2ea7060d8b2646 /src/bindings
parentefl-mono: Make override of methods only for methods that are defined by the user (diff)
csharp: Add some null checks.
Summary: - Check for nullness when getting stuff from C# to C - We should return null when wrapping a NULL pointer instead of throwing an exception Reviewers: felipealmeida, vitor.sousa, woohyun Reviewed By: vitor.sousa Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8580
Diffstat (limited to 'src/bindings')
1 files changed, 6 insertions, 0 deletions
diff --git a/src/bindings/mono/eo_mono/iwrapper.cs b/src/bindings/mono/eo_mono/iwrapper.cs
index f3696606d2..83d8fd53ca 100644
--- a/src/bindings/mono/eo_mono/iwrapper.cs
+++ b/src/bindings/mono/eo_mono/iwrapper.cs
@@ -589,6 +589,12 @@ public class Globals
/// <returns>The C# wrapper for this instance.</returns>
public static Efl.Eo.IWrapper CreateWrapperFor(System.IntPtr handle, bool shouldIncRef=true)
+ if (handle == IntPtr.Zero)
+ {
+ return null;
+ }
IntPtr eoKlass = efl_class_get(handle);
if (eoKlass == IntPtr.Zero)