From d4141acc3b1bed0103b8f8b5942a00b993f3c73b Mon Sep 17 00:00:00 2001 From: Marcus Whybrow Date: Mon, 2 Sep 2013 00:48:59 +0100 Subject: [PATCH] Check a tag has a name before matching against it --- assets/js/index.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/assets/js/index.js b/assets/js/index.js index 4854885..f024e8b 100644 --- a/assets/js/index.js +++ b/assets/js/index.js @@ -144,11 +144,13 @@ $(function() { tagVersion, match; $.each(tags, function(i, tag) { - match = tag.name.match(/^(\d+)\.(\d+)\.(\d+)$/); - if (match) { - tagVersion = matchToTagVersion(match); - if (compareTags(tagVersion, latestTagVersion) == 1) - latestTagVersion = tagVersion; + if (! tag.name === 'undefined') { + match = tag.name.match(/^(\d+)\.(\d+)\.(\d+)$/); + if (match) { + tagVersion = matchToTagVersion(match); + if (compareTags(tagVersion, latestTagVersion) == 1) + latestTagVersion = tagVersion; + } } });