Add code to check null parameter and throw exception 26/165626/1
authorSuyeon Hwang <stom.hwang@samsung.com>
Fri, 22 Dec 2017 10:53:24 +0000 (19:53 +0900)
committerSuyeon Hwang <stom.hwang@samsung.com>
Wed, 3 Jan 2018 02:14:19 +0000 (02:14 +0000)
Change-Id: I543f69f4537290040b4a49d01f06521227036c80
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/VoiceCommandList.cs

index 8573076..9f4308d 100755 (executable)
@@ -166,6 +166,9 @@ namespace Tizen.Uix.VoiceControl
         /// <exception cref="NullReferenceException">This will occur if the provided parameter is null.</exception>
         public void Add(VoiceCommand command)
         {
+            if (null == command) {
+                throw new NullReferenceException("Null Parameter Provided");
+            }
             ErrorCode error = VcCmdListAdd(_handle, command._handle);
             if (error != ErrorCode.None)
             {
@@ -196,6 +199,9 @@ namespace Tizen.Uix.VoiceControl
         /// <exception cref="NullReferenceException">This will occur if the provided parameter is null.</exception>
         public void Remove(VoiceCommand command)
         {
+            if (null == command) {
+                throw new NullReferenceException("Null Parameter Provided");
+            }
             ErrorCode error = VcCmdListRemove(_handle, command._handle);
             if (error != ErrorCode.None)
             {