[Applications.ComponentBased.ComponentPort] Add a missing exception (#2591)
authorhjhun <36876573+hjhun@users.noreply.github.com>
Mon, 1 Feb 2021 06:00:22 +0000 (15:00 +0900)
committerGitHub <noreply@github.com>
Mon, 1 Feb 2021 06:00:22 +0000 (15:00 +0900)
* Add a missing exception handling

Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
* Use IsNullOrEmpty()

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

index c7d68e4..33779c5 100755 (executable)
@@ -78,6 +78,11 @@ namespace Tizen.Applications.ComponentBased
         /// <since_tizen> 9 </since_tizen>
         public void AddPrivilege(string privilege)
         {
+            if (string.IsNullOrEmpty(privilege))
+            {
+                throw new ArgumentException("Invalid argument");
+            }
+
             Interop.ComponentPort.AddPrivilege(_port, privilege);
         }