Handle null in this function

Since ddb9ef30dc41715ff30c1178f3830e35e26cd042 in zuul ids will get
serialized as null for periodic jobs. After some of the code moved
around, this became a place where they were unhandled.

If you try to look at the status page while periodic jobs are running
without this patch, nothing will display.

Change-Id: I2cdf72a1532093e33039dcc0199cde0a0758cab1
Fix zuul status graph with failed change at head

With a failed change at the head, the second change was incorrectly
drawn with a branch line.

Change-Id: I9b9ea4e22a410aba89ac44a52f243de833ca35a0
Merge "Handle null in this function"
Merge "Fix zuul status graph with failed change at head"