[ComponentBased.ComponentManager][Adds an exception handling] (#1016)
authorhjhun <36876573+hjhun@users.noreply.github.com>
Tue, 17 Sep 2019 01:12:12 +0000 (10:12 +0900)
committerHyunho Kang <hhstark.kang@samsung.com>
Tue, 17 Sep 2019 01:12:12 +0000 (10:12 +0900)
To prevent null reference exception, checking a parameter is necessary.

Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/Tizen.Applications.ComponentBased.ComponentManager/Tizen.Applications/ComponentManager.cs

index 1654e72..4824e6f 100755 (executable)
@@ -154,6 +154,11 @@ namespace Tizen.Applications.ComponentBased
         /// <since_tizen> 6 </since_tizen>
         public static void TerminateBackgroundComponent(ComponentRunningContext context)
         {
+            if (context == null)
+            {
+                throw new ArgumentException("Invalid argument");
+            }
+
             Interop.ComponentManager.ErrorCode err = Interop.ComponentManager.ComponentManagerTerminateBgComponent(context._contextHandle);
             if (err != Interop.ComponentManager.ErrorCode.None)
             {