From c35f3736a64748928da09c08ca381161dc3bcda2 Mon Sep 17 00:00:00 2001
From: Pawel Andruszkiewicz
Date: Tue, 28 Jul 2015 08:58:47 +0200
Subject: [PATCH] [MessagePort] Input parameters cannot be empty.
[Verification] Wearable UTC: 29/29.
Mobile TCT: 48/48.
Change-Id: I0e266e10b6c748b5b90aa678165ed845f8e362f7
Signed-off-by: Pawel Andruszkiewicz
---
src/messageport/messageport_api.js | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/messageport/messageport_api.js b/src/messageport/messageport_api.js
index 2156fb44..872c75ff 100755
--- a/src/messageport/messageport_api.js
+++ b/src/messageport/messageport_api.js
@@ -113,6 +113,12 @@ MessagePortManager.prototype.requestLocalMessagePort = function(localMessagePort
var args = validator_.validateArgs(arguments, [
{'name' : 'localMessagePortName', 'type': types_.STRING}
]);
+
+ if ('' === args.localMessagePortName) {
+ throw new WebAPIException(WebAPIException.INVALID_VALUES_ERR,
+ 'Port name cannot be empty.');
+ }
+
var localPortId;
var nativeParam = {
'localMessagePortName': args.localMessagePortName
@@ -137,6 +143,11 @@ MessagePortManager.prototype.requestTrustedLocalMessagePort = function(localMess
{'name' : 'localMessagePortName', 'type': types_.STRING}
]);
+ if ('' === args.localMessagePortName) {
+ throw new WebAPIException(WebAPIException.INVALID_VALUES_ERR,
+ 'Port name cannot be empty.');
+ }
+
var nativeParam = {
'localMessagePortName': args.localMessagePortName
};
--
2.34.1