[NUI] add exception code for NUIWidgetApplication (#1802)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / NUIWidgetApplication.cs
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>