Add an exception handling about args
authorHwankyu Jhun <h.jhun@samsung.com>
Tue, 21 Feb 2017 05:09:10 +0000 (14:09 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Tue, 21 Feb 2017 05:09:10 +0000 (14:09 +0900)
Change-Id: I206b45b8100f956b4aedb8065404d50c10b09b6e
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/Tizen.Applications.Common/Tizen.Applications/CoreApplication.cs

index 8448e18..f37b310 100644 (file)
@@ -93,9 +93,18 @@ namespace Tizen.Applications
             _backend.AddEventHandler<LocaleChangedEventArgs>(EventType.LocaleChanged, OnLocaleChanged);
             _backend.AddEventHandler<RegionFormatChangedEventArgs>(EventType.RegionFormatChanged, OnRegionFormatChanged);
 
-            string[] argsClone = new string[args.Length + 1];
+            string[] argsClone = null;
+
+            if (args == null)
+            {
+                argsClone = new string[1];
+            }
+            else
+            {
+                argsClone = new string[args.Length + 1];
+                args.CopyTo(argsClone, 1);
+            }
             argsClone[0] = string.Empty;
-            args.CopyTo(argsClone, 1);
             _backend.Run(argsClone);
         }