From: Umar Date: Mon, 5 Jun 2017 16:23:48 +0000 (+0100) Subject: Ensure PropertyValue returned from native side is not null. X-Git-Tag: submit/trunk/20170823.075128~91^2~35^2~44 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5bf9bf4cdfae525b99e8cbc5af2afd4fce626f3c;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git Ensure PropertyValue returned from native side is not null. 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 --- diff --git a/src/Tizen.NUI/src/public/BaseComponents/View.cs b/src/Tizen.NUI/src/public/BaseComponents/View.cs index 177a6d1..54183e7 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/View.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/View.cs @@ -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;