From 7948059c91ca7ac57be3d3324622eb8c9d3c0cda Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Thu, 12 Oct 2017 00:22:18 +0900 Subject: [PATCH] Fix JS error when a link has no target xpressengine/xe-core#2162 --- common/js/common.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/js/common.js b/common/js/common.js index fa534bb71..ad4dd6bbf 100644 --- a/common/js/common.js +++ b/common/js/common.js @@ -225,7 +225,7 @@ jQuery(function($) { var $this = $(this); var href = $this.attr('href'); var target = $this.attr('target'); - if (target === '_top' || target === '_self' || target === '_parent') { + if (!href || !target || target === '_top' || target === '_self' || target === '_parent') { return; } if (!window.XE.isSameHost(href)) { @@ -242,7 +242,7 @@ jQuery(function($) { var $this = $(this); var href = $this.attr('href'); var target = $this.attr('target'); - if (target === '_top' || target === '_self' || target === '_parent') { + if (!href || !target || target === '_top' || target === '_self' || target === '_parent') { return; } if (!window.XE.isSameHost(href)) {