[MediaController] Throw exception when position is lower than zero.
authorRafal Galka <r.galka@samsung.com>
Mon, 15 Jun 2015 13:39:17 +0000 (15:39 +0200)
committerRafal Galka <r.galka@samsung.com>
Mon, 15 Jun 2015 13:39:17 +0000 (15:39 +0200)
[Info]
http://168.219.209.56/gerrit/#/c/49643/3..4/web/widl/tizen/mediacontroller.widl

Change-Id: I2bc05cd74dcb20cf47a8fb71548a62aa9f8a1521

src/mediacontroller/mediacontroller_api.js

index 89a34345b8e4d3f441e87a9a0f216bb9d112c61c..a018b07c4af069ceea2613b5a69e8e0649e0972d 100755 (executable)
@@ -13,7 +13,7 @@
  *    See the License for the specific language governing permissions and
  *    limitations under the License.
  */
+
 var utils_ = xwalk.utils;
 var type_ = utils_.type;
 var converter_ = utils_.converter;
@@ -358,6 +358,10 @@ MediaControllerServer.prototype.updatePlaybackPosition = function(position) {
     {name: 'position', type: types_.LONG_LONG}
   ]);
 
+  if (args.position < 0) {
+    throw new WebAPIException(WebAPIException.INVALID_VALUES_ERR);
+  }
+
   var data = {
     position: args.position
   };
@@ -601,6 +605,10 @@ MediaControllerServerInfo.prototype.sendPlaybackPosition = function(position, su
     {name: 'errorCallback', type: types_.FUNCTION, optional: true, nullable: true}
   ]);
 
+  if (args.position < 0) {
+    throw new WebAPIException(WebAPIException.INVALID_VALUES_ERR);
+  }
+
   var data = {
     position: args.position
   };