[MessagePort] Input parameters cannot be empty.
authorPawel Andruszkiewicz <p.andruszkie@samsung.com>
Tue, 28 Jul 2015 06:58:47 +0000 (08:58 +0200)
committerPawel Andruszkiewicz <p.andruszkie@samsung.com>
Tue, 28 Jul 2015 08:35:18 +0000 (10:35 +0200)
[Verification] Wearable UTC: 29/29.
               Mobile TCT: 48/48.

Change-Id: I0e266e10b6c748b5b90aa678165ed845f8e362f7
Signed-off-by: Pawel Andruszkiewicz <p.andruszkie@samsung.com>
src/messageport/messageport_api.js

index 2156fb4..872c75f 100755 (executable)
@@ -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
   };