Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
chenshay committed May 30, 2017
1 parent 83a10ec commit 9b3e477
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion extensions/amp-viewer-integration/0.1/messaging/messaging.js
Expand Up @@ -55,7 +55,13 @@ export function parseMessage(message) {
if (message.charAt(0) != '{') {
return null;
}
return /** @type {?Message} */ (JSON.parse(/** @type {string} */ (message)));

try {
return /** @type {?Message} */ (
JSON.parse(/** @type {string} */ (message)));
} catch (e) {
return null;
}
}


Expand Down
Expand Up @@ -19,8 +19,8 @@ import {
Messaging,
WindowPortEmulator,
parseMessage,
} from '../messaging/messaging.js';
import {ViewerForTesting} from './viewer-for-testing.js';
} from '../messaging/messaging';
import {ViewerForTesting} from './viewer-for-testing';
import {getSourceUrl} from '../../../../src/url';


Expand Down

0 comments on commit 9b3e477

Please sign in to comment.