Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Commit

Permalink
Merge pull request #254 from methyl/master
Browse files Browse the repository at this point in the history
Fix the problem with exception after receiving msg from another source.
  • Loading branch information
oyvindkinsey committed Feb 10, 2018
2 parents 2898834 + 23d0a23 commit 6f274d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/stack/PostMessageTransport.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ easyXDM.stack.PostMessageTransport = function(config){
// #ifdef debug
trace("received message '" + event.data + "' from " + origin);
// #endif
if (origin == targetOrigin && event.data.substring(0, config.channel.length + 1) == config.channel + " ") {
if (origin == targetOrigin && typeof event.data === 'string' && event.data.substring(0, config.channel.length + 1) == config.channel + " ") {
pub.up.incoming(event.data.substring(config.channel.length + 1), origin);
}
}
Expand Down

0 comments on commit 6f274d5

Please sign in to comment.