summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2016-12-28 11:28:52 -0600
committerMike Greiling <mike@pixelcog.com>2016-12-28 11:28:52 -0600
commit5fe5f33d6ba40ef4f934d60575910f6999534042 (patch)
treeba5e54a52f06ec51a3ed36a49a0a72f662282400
parent4704a59768dd34c588c50f83206f4f9a1a1dc71f (diff)
downloadgitlab-ce-5fe5f33d6ba40ef4f934d60575910f6999534042.tar.gz
don't take for granted that all anchor tags have an href attribute
-rw-r--r--app/assets/javascripts/application.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js
index 7024691f9f7..13d5c6e1e0b 100644
--- a/app/assets/javascripts/application.js
+++ b/app/assets/javascripts/application.js
@@ -92,7 +92,7 @@
// `hashchange` is not triggered when link target is already in window.location
$body.on('click', 'a', function() {
var href = this.getAttribute('href');
- if (href.indexOf('#') === 0 && href.substr(1) === gl.utils.getLocationHash()) {
+ if (href && href.indexOf('#') === 0 && href.substr(1) === gl.utils.getLocationHash()) {
setTimeout(gl.utils.handleLocationHash, 1);
}
});