[NUI] add exception code for NUIWidgetApplication (#1802)
authortscholb <scholb.kim@samsung.com>
Mon, 6 Jul 2020 10:33:50 +0000 (19:33 +0900)
committerGitHub <noreply@github.com>
Mon, 6 Jul 2020 10:33:50 +0000 (19:33 +0900)
if application use null dictionary for creating NUIWidgetApplication,
we need to throw exception.

src/Tizen.NUI/src/public/NUIWidgetApplication.cs [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 0bec8a1..a34bb89
@@ -18,6 +18,7 @@ using Tizen.Applications;
 using Tizen.Applications.CoreBackend;
 using System.Collections.Generic;
 using System.ComponentModel;
+using System;
 
 namespace Tizen.NUI
 {
@@ -44,8 +45,15 @@ namespace Tizen.NUI
         /// <param name="widgetTypes">List of derived widget class type.</param>
         public NUIWidgetApplication(Dictionary<System.Type, string> widgetTypes) : base(new NUIWidgetCoreBackend())
         {
-            NUIWidgetCoreBackend core = Backend as NUIWidgetCoreBackend;
-            core?.RegisterWidgetInfo(widgetTypes);
+            if( widgetTypes == null )
+            {
+              throw new InvalidOperationException("Dictionary is null");
+            }
+            else
+            {
+                NUIWidgetCoreBackend core = Backend as NUIWidgetCoreBackend;
+                core?.RegisterWidgetInfo(widgetTypes);
+            }
         }
 
         /// <summary>