From 73f2866194fb775847482ca0d2d9903f9fd1cd4e Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Fri, 19 Feb 2016 03:46:59 +0000 Subject: [PATCH] Customize: Prevent consecutive `refresh` requests from preview from causing JS error. Fixes "Uncaught TypeError: this.targetWindow is not a function". See #27355. Fixes #35866. git-svn-id: https://develop.svn.wordpress.org/trunk@36583 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/js/customize-base.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/js/customize-base.js b/src/wp-includes/js/customize-base.js index 79ba46430a..b4b727951c 100644 --- a/src/wp-includes/js/customize-base.js +++ b/src/wp-includes/js/customize-base.js @@ -704,8 +704,9 @@ window.wp = window.wp || {}; event = event.originalEvent; - if ( ! this.targetWindow() ) + if ( ! this.targetWindow || ! this.targetWindow() ) { return; + } // Check to make sure the origin is valid. if ( this.origin() && event.origin !== this.origin() )