Check a tag has a name before matching against it

This commit is contained in:
Marcus Whybrow 2013-09-02 00:48:59 +01:00
parent f412ab3974
commit d4141acc3b

View File

@ -144,11 +144,13 @@ $(function() {
tagVersion, match; tagVersion, match;
$.each(tags, function(i, tag) { $.each(tags, function(i, tag) {
match = tag.name.match(/^(\d+)\.(\d+)\.(\d+)$/); if (! tag.name === 'undefined') {
if (match) { match = tag.name.match(/^(\d+)\.(\d+)\.(\d+)$/);
tagVersion = matchToTagVersion(match); if (match) {
if (compareTags(tagVersion, latestTagVersion) == 1) tagVersion = matchToTagVersion(match);
latestTagVersion = tagVersion; if (compareTags(tagVersion, latestTagVersion) == 1)
latestTagVersion = tagVersion;
}
} }
}); });