]> O.S.I.I.S - jp/crow.git/commitdiff
test datasource null in bindings
authorjpbruyere <jp.bruyere@hotmail.com>
Sun, 13 Mar 2016 22:35:04 +0000 (23:35 +0100)
committerjpbruyere <jp.bruyere@hotmail.com>
Sun, 13 Mar 2016 22:35:04 +0000 (23:35 +0100)
src/CompilerServices/CompilerServices.cs

index aea199f42fdabc944a391fc985194c46ba2e565f..da5c0fe48b1f4e251460ac50c7e79176fb02f43b 100644 (file)
@@ -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;
                        }