[Common] Added missing return statement 43/193343/1
authorPiotr Kosko/Native/Web API (SWP) /SRPOL/Professional/삼성전자 <p.kosko@samsung.com>
Mon, 19 Nov 2018 13:46:34 +0000 (14:46 +0100)
committerPiotr Kosko/Native/Web API (SWP) /SRPOL/Professional/삼성전자 <p.kosko@samsung.com>
Mon, 19 Nov 2018 13:46:37 +0000 (14:46 +0100)
[Bug] When parsing invalid message, exception is catched, but the control
  is not finished. Going to following lines, other exception would be raised.
  We need to finish execution for invalid message.

[Verification] Code compiles without errors.

Change-Id: I65784e775b9a765332c4a1f0a19b8184e896872c
Signed-off-by: Piotr Kosko/Native/Web API (SWP) /SRPOL/Professional/삼성전자 <p.kosko@samsung.com>
src/utils/utils_api.js

index 2eef03e1e58733cf7f61fdd1b30b466862885da0..f99b4e47967d177a69d72d84b3205c62aa2e93d8 100644 (file)
@@ -1020,7 +1020,8 @@ var NativeManager = function(extension) {
     try {
       var msg = JSON_.parse(json);
     } catch (error) {
-      xwalk.utils.error('Invalid JSON received: ' + json);
+      xwalk.utils.error('Ignoring message - Invalid JSON received: ' + json);
+      return;
     }
     var id;