From eaeba42373ef80bf638bb5e1fbead2bd57b6e67c Mon Sep 17 00:00:00 2001 From: Umar Date: Mon, 5 Jun 2017 17:23:48 +0100 Subject: [PATCH] [Tizen] 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. Conflicts: Tizen.NUI/src/public/BaseComponents/View.cs Change-Id: I2e2fe44a94e4fde15c259a9e67655dfabf165e95 --- src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs | 2 +- src/Tizen.NUI/src/public/BaseComponents/View.cs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs b/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs index c49d3df97..adc4a0eb8 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs @@ -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; } } diff --git a/src/Tizen.NUI/src/public/BaseComponents/View.cs b/src/Tizen.NUI/src/public/BaseComponents/View.cs index 9f4a057a8..f9d4e8ffa 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/View.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/View.cs @@ -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; -- 2.34.1