HistoryView: only add parents if parents array exists

This used to break if a commit had no parents. This wasn't noticed
before because the breakage is only minor -- the only way you see it
is because the detail view didn't scroll up afterwards.
This commit is contained in:
Pieter de Bie
2009-06-12 00:15:00 +01:00
parent 60908fd143
commit 5f97caabd1
+6 -3
View File
@@ -184,15 +184,18 @@ var loadCommit = function(commitObject, currentRef) {
}
}
// Scroll to top
scroll(0, 0);
if (!commit.parents)
return;
for (var i = 0; i < commit.parents.length; i++) {
var newRow = $("commit_header").insertRow(-1);
newRow.innerHTML = "<td class='property_name'>Parent:</td><td>" +
"<a href='' onclick='selectCommit(this.innerHTML); return false;'>" +
commit.parents[i] + "</a></td>";
}
// Scroll to top
scroll(0, 0);
}
var showDiff = function() {