From: Pawel Andruszkiewicz Date: Wed, 29 Jul 2015 09:14:57 +0000 (+0200) Subject: [Filesystem] Fixed argument validation in readBytes(). X-Git-Tag: submit/tizen_tv/20150803.021740^2^2~8^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9984084acbb2c1fcb8ec37f26ffc613ea27e96ef;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [Filesystem] Fixed argument validation in readBytes(). Fixes: UTC_filesystem_file_readBytes_error_invalid_param_N_001 [Verification] [Verification] Wearable service UTC: 93/94 Mobile TCT: 289/289 Change-Id: I4e4efc4bca5a74e3e9463bad11f5092c784b846c Signed-off-by: Pawel Andruszkiewicz --- diff --git a/src/filesystem/js/file_stream.js b/src/filesystem/js/file_stream.js index c5c9e431..b0ede171 100755 --- a/src/filesystem/js/file_stream.js +++ b/src/filesystem/js/file_stream.js @@ -141,16 +141,8 @@ FileStream.prototype.readBytes = function() { _checkClosed(this); _checkReadAccess(this._mode); - if (!arguments.length) { - throw new WebAPIException(WebAPIException.INVALID_VALUES_ERR, - 'Argument "byteCount" missing'); - } - if (!type_.isNumber(args.byteCount)) { - throw new WebAPIException(WebAPIException.TYPE_MISMATCH_ERR, - 'Argument "byteCount" must be a number'); - } if (args.byteCount <= 0) { - throw new WebAPIException(WebAPIException.TYPE_MISMATCH_ERR, + throw new WebAPIException(WebAPIException.INVALID_VALUES_ERR, 'Argument "byteCount" must be greater than 0'); }