From c5f5c67e005c2e54ed48f18ac49c2dc9a85c3751 Mon Sep 17 00:00:00 2001 From: Suyeon Hwang Date: Fri, 22 Dec 2017 19:53:24 +0900 Subject: [PATCH] Add code to check null parameter and throw exception Change-Id: I543f69f4537290040b4a49d01f06521227036c80 Signed-off-by: Suyeon Hwang --- .../Tizen.Uix.VoiceControl/VoiceCommandList.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/VoiceCommandList.cs b/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/VoiceCommandList.cs index 8573076..9f4308d 100755 --- a/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/VoiceCommandList.cs +++ b/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/VoiceCommandList.cs @@ -166,6 +166,9 @@ namespace Tizen.Uix.VoiceControl /// This will occur if the provided parameter is null. 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 /// This will occur if the provided parameter is null. public void Remove(VoiceCommand command) { + if (null == command) { + throw new NullReferenceException("Null Parameter Provided"); + } ErrorCode error = VcCmdListRemove(_handle, command._handle); if (error != ErrorCode.None) { -- 2.7.4