If args is null, throwing ArgumentNullException is occurred.
The null check logic is unnecessary. It's removed.
This patch checks the length of args before copying args.
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
_backend.AddEventHandler<RegionFormatChangedEventArgs>(EventType.RegionFormatChanged, OnRegionFormatChanged);
_backend.AddEventHandler<DeviceOrientationEventArgs>(EventType.DeviceOrientationChanged, OnDeviceOrientationChanged);
- string[] argsClone = null;
-
- if (args == null)
- {
- argsClone = new string[1];
- }
- else
+ string[] argsClone = new string[args.Length + 1];
+ if (args.Length > 1)
{
- argsClone = new string[args.Length + 1];
args.CopyTo(argsClone, 1);
}
argsClone[0] = string.Empty;
+
_backend.Run(argsClone);
}