[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 2857c66..a34bb89
@@ -18,6 +18,7 @@ using Tizen.Applications;
 using Tizen.Applications.CoreBackend;
 using System.Collections.Generic;
 using System.ComponentModel;
+using System;
 
 namespace Tizen.NUI
 {
@@ -42,11 +43,17 @@ namespace Tizen.NUI
         /// The constructor for multi widget class and instance.
         /// </summary>
         /// <param name="widgetTypes">List of derived widget class type.</param>
-        [EditorBrowsable(EditorBrowsableState.Never)]
         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>