From b970f0431deef8bb13370613a51af0d3dc92c55e Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Fri, 9 Sep 2016 18:03:59 -0400 Subject: [PATCH] Fix linkifying branch references --- .js/github.com.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.js/github.com.js b/.js/github.com.js index 9e7f1c5..db43f13 100644 --- a/.js/github.com.js +++ b/.js/github.com.js @@ -64,12 +64,15 @@ let repoUrl = $("div.repohead-details-container > h1.public > strong[itemprop=na (function() { $("span.commit-ref").each((i, el) => { el = $(el); - let bits = el.attr("title").split(":"); - let repo = bits[0]; - let branch = bits[1]; - let link = $(""); - link.attr("href", `https://github.com/${repo}/tree/${branch}`); - el.wrap(link); + let title = el.attr("title"); + if (title) { + let bits = title.split(":"); + let repo = bits[0]; + let branch = bits[1]; + let link = $(""); + link.attr("href", `https://github.com/${repo}/tree/${branch}`); + el.wrap(link); + } }); $("body").after(""); })();