[NUI] Fix svace issue of dereferencing possible null handle in TextUtils
authorJaehyun Cho <jae_hyun.cho@samsung.com>
Thu, 9 Sep 2021 02:57:42 +0000 (11:57 +0900)
committerSeoyeon2Kim <34738918+Seoyeon2Kim@users.noreply.github.com>
Mon, 13 Sep 2021 07:33:23 +0000 (16:33 +0900)
Since PropertyMap.Find can return null, Find().Get() should be replaced with
Find()?.Get().

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

index 618de4f..08ee53c 100755 (executable)
@@ -1651,9 +1651,9 @@ namespace Tizen.NUI.BaseComponents
 
             map.Find(0)?.Get(out text);
             map.Find(1)?.Get(out textFocused);
-            map.Find(2).Get(color);
+            map.Find(2)?.Get(color);
             map.Find(3)?.Get(out fontFamily);
-            map.Find(4).Get(fontStyle);
+            map.Find(4)?.Get(fontStyle);
             pointSizeValue = map.Find(5);
             pixelSizeValue = map.Find(6);
             map.Find(7)?.Get(out ellipsis);