[Pkg-javascript-commits] [sockjs-client] 318/350: Fix #246 move iframe.contentWindow check inside the setTimeout

tonnerre at ancient-solutions.com tonnerre at ancient-solutions.com
Fri Aug 5 01:04:34 UTC 2016


This is an automated email from the git hooks/post-receive script.

tonnerre-guest pushed a commit to branch upstream
in repository sockjs-client.

commit d2447fc593ab68c70f1c9a5ca793346a7bb6ccfc
Author: Bryce Kahle <bkahle at gmail.com>
Date:   Sun Jul 19 19:52:14 2015 -0700

    Fix #246 move iframe.contentWindow check inside the setTimeout
---
 lib/utils/iframe.js | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/lib/utils/iframe.js b/lib/utils/iframe.js
index cdef8aa..bfe7884 100644
--- a/lib/utils/iframe.js
+++ b/lib/utils/iframe.js
@@ -72,11 +72,11 @@ module.exports = {
       try {
         // When the iframe is not loaded, IE raises an exception
         // on 'contentWindow'.
-        if (iframe && iframe.contentWindow) {
-          setTimeout(function() {
+        setTimeout(function() {
+          if (iframe && iframe.contentWindow) {
             iframe.contentWindow.postMessage(msg, origin);
-          }, 0);
-        }
+          }
+        }, 0);
       } catch (x) {}
     };
 
@@ -138,11 +138,11 @@ module.exports = {
       try {
         // When the iframe is not loaded, IE raises an exception
         // on 'contentWindow'.
-        if (iframe && iframe.contentWindow) {
-          setTimeout(function() {
-            iframe.contentWindow.postMessage(msg, origin);
-          }, 0);
-        }
+        setTimeout(function() {
+          if (iframe && iframe.contentWindow) {
+              iframe.contentWindow.postMessage(msg, origin);
+          }
+        }, 0);
       } catch (x) {}
     };
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/sockjs-client.git



More information about the Pkg-javascript-commits mailing list