When there's no data in the commits table, this will fail when you try to do this.commits[commitIndex].hash on line 136