Ensure PropertyValue returned from native side is not null.
authorUmar <m.umar@partner.samsung.com>
Mon, 5 Jun 2017 16:23:48 +0000 (17:23 +0100)
committerUmar <m.umar@partner.samsung.com>
Mon, 5 Jun 2017 16:57:41 +0000 (17:57 +0100)
The BACKGROUND property returns a PropertyMap and we are trying to find Visual.Property.Type inside that PropertyMap which is not available as it has not been set in the application side, and hence causing a crash. Anyway, this has now been fixed by adding null checks.

Change-Id: I2e2fe44a94e4fde15c259a9e67655dfabf165e95

src/Tizen.NUI/src/public/BaseComponents/View.cs

index 177a6d1..54183e7 100755 (executable)
@@ -989,10 +989,10 @@ namespace Tizen.NUI.BaseComponents
 
                 Tizen.NUI.PropertyMap background = Background;
                 int visualType = 0;
-                background.Find(Visual.Property.Type).Get(out visualType);
+                background.Find(Visual.Property.Type)?.Get(out visualType);
                 if (visualType == (int)Visual.Type.Color)
                 {
-                    background.Find(ColorVisualProperty.MixColor).Get(backgroundColor);
+                    background.Find(ColorVisualProperty.MixColor)?.Get(backgroundColor);
                 }
 
                 return backgroundColor;
@@ -1014,10 +1014,10 @@ namespace Tizen.NUI.BaseComponents
 
                 Tizen.NUI.PropertyMap background = Background;
                 int visualType = 0;
-                background.Find(Visual.Property.Type).Get(out visualType);
+                background.Find(Visual.Property.Type)?.Get(out visualType);
                 if (visualType == (int)Visual.Type.Image)
                 {
-                    background.Find(ImageVisualProperty.URL).Get(out backgroundImage);
+                    background.Find(ImageVisualProperty.URL)?.Get(out backgroundImage);
                 }
 
                 return backgroundImage;