From: jpbruyere Date: Sun, 13 Mar 2016 22:35:04 +0000 (+0100) Subject: test datasource null in bindings X-Git-Tag: v0.4~82 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=09e26d9c08d22f31e1164237d63e2757822ff5d6;p=jp%2Fcrow.git test datasource null in bindings --- diff --git a/src/CompilerServices/CompilerServices.cs b/src/CompilerServices/CompilerServices.cs index aea199f4..da5c0fe4 100644 --- a/src/CompilerServices/CompilerServices.cs +++ b/src/CompilerServices/CompilerServices.cs @@ -105,7 +105,10 @@ namespace Crow //if binding exp = '{}' => binding is done on datasource if (string.IsNullOrEmpty (Expression)) { - Source = new MemberReference ((Target.Instance as GraphicObject).DataSource); + Object o = (Target.Instance as GraphicObject).DataSource; + if (o == null) + return false; + Source = new MemberReference (o); return true; }