[NUI.Gadget] Fix static analysis issue (#4968)
authorhjhun <36876573+hjhun@users.noreply.github.com>
Tue, 7 Feb 2023 02:51:59 +0000 (11:51 +0900)
committerGitHub <noreply@github.com>
Tue, 7 Feb 2023 02:51:59 +0000 (11:51 +0900)
Checker:
 - DEREF_OF_NULL

Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetManager.cs

index 0220ebd..fda5e27 100755 (executable)
@@ -50,7 +50,10 @@ namespace Tizen.NUI
                     foreach (string packageId in packages.Split(':').ToList())
                     {
                         NUIGadgetInfo info = NUIGadgetInfo.CreateNUIGadgetInfo(packageId);
-                        _gadgetInfos.Add(info.ResourceType, info);
+                        if (info != null)
+                        {
+                            _gadgetInfos.Add(info.ResourceType, info);
+                        }
                     }
                 }
             }