Skip to content
This repository was archived by the owner on Oct 8, 2024. It is now read-only.

Commit

Permalink
bug fix for returning if post message is null
Browse files Browse the repository at this point in the history
  • Loading branch information
ecaroth committed Apr 6, 2016
1 parent 8c9928f commit 88fa74d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/xdomain_cookie.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
}catch(e){
var data = null;
}
if(typeof data=='object' && !(data instanceof Array) && 'msg_type' in data && data.msg_type=='xdsc_read' && 'namespace' in data && data.namespace === _namespace){
if(!data) return;
if(typeof data==='object' && !(data instanceof Array) && 'msg_type' in data && data.msg_type=='xdsc_read' && 'namespace' in data && data.namespace === _namespace){
//NOTE - the only thing iframe postMessages to us is when it's initially loaded, and it includes payload of all cookies set on iframe domain
_xdomain_cookie_data = data.cookies;
_iframe_ready = true;
Expand Down

0 comments on commit 88fa74d

Please sign in to comment.