[Tizen] Ensure PropertyValue returned from native side is not null. 63/132763/1
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

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

index c49d3df..adc4a0e 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 9f4a057..f9d4e8f 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;