From: Suyeon Hwang Date: Fri, 22 Dec 2017 10:53:24 +0000 (+0900) Subject: Add code to check null parameter and throw exception X-Git-Tag: 4.0.1-preview1-00053~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c5f5c67e005c2e54ed48f18ac49c2dc9a85c3751;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git Add code to check null parameter and throw exception Change-Id: I543f69f4537290040b4a49d01f06521227036c80 Signed-off-by: Suyeon Hwang --- diff --git a/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/VoiceCommandList.cs b/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/VoiceCommandList.cs index 8573076b2..9f4308d5a 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) {