[NUI] Fix crash when View.BackgroundImage is set
authorJaehyun Cho <jae_hyun.cho@samsung.com>
Tue, 23 Nov 2021 07:37:56 +0000 (16:37 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Tue, 23 Nov 2021 08:47:11 +0000 (17:47 +0900)
Previously, View.BackgroundImage is set, PropertyValue constructor can
be called with null pointer and this causes crash.

Now, it has been fixed not to pass null pointer to PropertyValue
constructor.

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

index 388a352..46e4023 100755 (executable)
@@ -2399,7 +2399,7 @@ namespace Tizen.NUI.BaseComponents
             var borderlineOffset = new PropertyValue(backgroundExtraData.BorderlineOffset);
             var synchronousLoading = new PropertyValue(backgroundImageSynchronousLoading);
             var npatchType = new PropertyValue((int)Visual.Type.NPatch);
-            var border = new PropertyValue(backgroundExtraData.BackgroundImageBorder);
+            var border = (backgroundExtraData.BackgroundImageBorder != null) ? new PropertyValue(backgroundExtraData.BackgroundImageBorder) : null;
             var imageType = new PropertyValue((int)Visual.Type.Image);
 
             map.Add(ImageVisualProperty.URL, url)