diff --git a/templates/repository/log.html b/templates/repository/log.html
index 696fe32..2ddb8f8 100644
--- a/templates/repository/log.html
+++ b/templates/repository/log.html
@@ -72,10 +72,14 @@
{{ commit_time(commit.commit_time, commit.commit_time_offset)|ago }}
- {{ diff[commit.short_id].stats.files_changed }}
+ {% if commit.short_id in diff %}
+ {{ diff[commit.short_id].stats.files_changed }}
+ {% endif %}
|
- -{{ diff[commit.short_id].stats.deletions }}/+{{ diff[commit.short_id].stats.insertions }}
+ {% if commit.short_id in diff %}
+ -{{ diff[commit.short_id].stats.deletions }}/+{{ diff[commit.short_id].stats.insertions }}
+ {% endif %}
|
{% endfor %}
diff --git a/web.py b/web.py
index b1331f9..4386480 100644
--- a/web.py
+++ b/web.py
@@ -505,7 +505,9 @@ def log(repository, revision):
break
commits.append(commit)
- diff[commit.short_id] = commit.parents[0].tree.diff_to_tree(commit.tree)
+
+ if len(commit.parents) > 0:
+ diff[commit.short_id] = commit.parents[0].tree.diff_to_tree(commit.tree)
return template(
'repository/log.html',