diff --git a/app/assets/javascripts/branch-graph.js b/app/assets/javascripts/branch-graph.js
index 520336adc0f909d6f830359374dc1cd87bf07398..525b17954b084e6d3b996e88381314d1f051f97b 100644
--- a/app/assets/javascripts/branch-graph.js
+++ b/app/assets/javascripts/branch-graph.js
@@ -118,58 +118,56 @@
       for (var j = 0, jj = this.commits[i].parents.length; j < jj; j++) {
         c = this.preparedCommits[this.commits[i].parents[j][0]];
         ps = this.commits[i].parents[j][1];
-        if (c) {
-          var cx = offsetX + 20 * c.time
-            , cy = offsetY + 10 * c.space
-            , psy = offsetY + 10 * ps;
-          if (c.space == this.commits[i].space && c.space == ps) {
-            r.path([
-              "M", x, y,
-              "L", cx, cy
-            ]).attr({
-              stroke: this.colors[c.space], 
-              "stroke-width": 2
-            });
+        var cx = offsetX + 20 * c.time
+          , cy = offsetY + 10 * c.space
+          , psy = offsetY + 10 * ps;
+        if (c.space == this.commits[i].space && c.space == ps) {
+          r.path([
+            "M", x, y,
+            "L", cx, cy
+          ]).attr({
+            stroke: this.colors[c.space], 
+            "stroke-width": 2
+          });
 
-          } else if (c.space < this.commits[i].space) {
-            if (y == psy) {
-                r.path([
-                    "M", x - 5, y,
-                    "l-5,-2,0,4,5,-2",
-                    "L", x - 10, y,
-                    "L", x - 15, psy,
-                    "L", cx + 5, psy,
-                    "L", cx, cy])
-                .attr({
-                  stroke: this.colors[this.commits[i].space], 
-                  "stroke-width": 2
-                });
-            } else {
-                r.path([
-                    "M", x - 3, y - 6,
-                    "l-4,-3,4,-2,0,5",
-                    "L", x - 5, y - 10,
-                    "L", x - 10, psy,
-                    "L", cx + 5, psy,
-                    "L", cx, cy])
-                .attr({
-                  stroke: this.colors[this.commits[i].space], 
-                  "stroke-width": 2
-                });
-            }
+        } else if (c.space < this.commits[i].space) {
+          if (y == psy) {
+              r.path([
+                  "M", x - 5, y,
+                  "l-5,-2,0,4,5,-2",
+                  "L", x - 10, y,
+                  "L", x - 15, psy,
+                  "L", cx + 5, psy,
+                  "L", cx, cy])
+              .attr({
+                stroke: this.colors[this.commits[i].space], 
+                "stroke-width": 2
+              });
           } else {
-            r.path([
-                "M", x - 3, y + 6,
-                "l-4,3,4,2,0,-5",
-                "L", x - 5, y + 10,
-                "L", x - 10, psy,
-                "L", cx + 5, psy,
-                "L", cx, cy])
-            .attr({
-              stroke: this.colors[c.space], 
-              "stroke-width": 2
-            });
+              r.path([
+                  "M", x - 3, y - 6,
+                  "l-4,-3,4,-2,0,5",
+                  "L", x - 5, y - 10,
+                  "L", x - 10, psy,
+                  "L", cx + 5, psy,
+                  "L", cx, cy])
+              .attr({
+                stroke: this.colors[this.commits[i].space], 
+                "stroke-width": 2
+              });
           }
+        } else {
+          r.path([
+              "M", x - 3, y + 6,
+              "l-4,3,4,2,0,-5",
+              "L", x - 5, y + 10,
+              "L", x - 10, psy,
+              "L", cx + 5, psy,
+              "L", cx, cy])
+          .attr({
+            stroke: this.colors[c.space], 
+            "stroke-width": 2
+          });
         }
       }