From 5f97caabd10f45f67121025fb804bd7c557494fa Mon Sep 17 00:00:00 2001 From: Pieter de Bie Date: Fri, 12 Jun 2009 00:15:00 +0100 Subject: [PATCH] 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. --- html/views/history/history.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/html/views/history/history.js b/html/views/history/history.js index 78184e8..af389ef 100644 --- a/html/views/history/history.js +++ b/html/views/history/history.js @@ -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 = "Parent:" + "" + commit.parents[i] + ""; } - - // Scroll to top - scroll(0, 0); } var showDiff = function() {