[Tizen] 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)
committerdongsug.song <dongsug.song@samsung.com>
Wed, 7 Jun 2017 10:57:00 +0000 (19:57 +0900)
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.

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

Change-Id: I2e2fe44a94e4fde15c259a9e67655dfabf165e95

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

index c49d3df978af172fdb43f1246a8f73fb44fa81ff..adc4a0eb882149a0d8c787955c34e59e3690518e 100755 (executable)
@@ -1282,7 +1282,7 @@ namespace Tizen.NUI.BaseComponents
             get
             {
                 int temp = 0;
-                GetProperty(TextEditor.Property.LINE_COUNT).Get(out temp);
+                GetProperty(TextEditor.Property.LINE_COUNT).Get(ref temp);
                 return temp;
             }
         }
index 9f4a057a84223beb6591a058d956c8ceec940227..f9d4e8ffa56a2f524eab3141d6312b149ef998bb 100755 (executable)
@@ -1091,10 +1091,10 @@ namespace Tizen.NUI.BaseComponents
 
                 Tizen.NUI.PropertyMap background = Background;
                 int visualType = 0;
-                background.Find(Visual.Property.Type).Get(ref visualType);
+                background.Find(Visual.Property.Type)?.Get(ref visualType);
                 if (visualType == (int)Visual.Type.Color)
                 {
-                    background.Find(ColorVisualProperty.MixColor).Get(backgroundColor);
+                    background.Find(ColorVisualProperty.MixColor)?.Get(backgroundColor);
                 }
 
                 return backgroundColor;
@@ -1116,10 +1116,10 @@ namespace Tizen.NUI.BaseComponents
 
                 Tizen.NUI.PropertyMap background = Background;
                 int visualType = 0;
-                background.Find(Visual.Property.Type).Get(ref visualType);
+                background.Find(Visual.Property.Type)?.Get(ref visualType);
                 if (visualType == (int)Visual.Type.Image)
                 {
-                    background.Find(ImageVisualProperty.URL).Get(out backgroundImage);
+                    background.Find(ImageVisualProperty.URL)?.Get(out backgroundImage);
                 }
 
                 return backgroundImage;