From 51a092ee7b4c444004c88f02a85617721e96ec74 Mon Sep 17 00:00:00 2001
From: Piotr Czaja
Date: Tue, 17 Feb 2015 12:23:12 +0100
Subject: [PATCH] [TVAudio] Throw exception if 'setVolume' is called without
argument
[Verification] 'setVolume' called without argument throws
InvalidValuesError.
Change-Id: I2f847be94a46342916cd3fb791b87f3882e98ca6
Signed-off-by: Piotr Czaja
---
src/tvaudio/tvaudio_api.js | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/tvaudio/tvaudio_api.js b/src/tvaudio/tvaudio_api.js
index 8613d67c..58a9ffc3 100644
--- a/src/tvaudio/tvaudio_api.js
+++ b/src/tvaudio/tvaudio_api.js
@@ -83,6 +83,11 @@ AudioControlManager.prototype.setVolume = function(volume) {
'Volume is out of range: ' + args.volume, 'InvalidValuesError');
}
+ if (arguments.length < 1) {
+ throw new tizen.WebAPIException(tizen.WebAPIException.INVALID_VALUES_ERR,
+ 'no volume argument: ' + arguments.length, 'InvalidValuesError');
+ }
+
var ret = native.callSync('AudioControlManager_setVolume', {
volume: args.volume
});
--
2.34.1