From 1e9d097a0a9baffdf769b1b2e38e8a24d9d59b48 Mon Sep 17 00:00:00 2001 From: john gravois Date: Wed, 12 Apr 2017 14:41:19 -0700 Subject: [PATCH] dont redirect empty queries (#93) --- src/assets/js/github.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/assets/js/github.js b/src/assets/js/github.js index 4bbe273..2bdd747 100644 --- a/src/assets/js/github.js +++ b/src/assets/js/github.js @@ -57,7 +57,9 @@ function redirectIfQuery() { redirected = false; delimiterPosition = pageName.indexOf('#'); - if (delimiterPosition > 0) { + + // if a hashed query is passed and cant be matched with our list of valid topics, redirect a canned github search + if (pageName.length - 1 > delimiterPosition) { for (i=1; i < topicList.length; i++) { if (pageName.substr(delimiterPosition + 1) === topicList[i].innerHTML) { return redirected;