added null checking and git wrapper exceptions