[JENKINS-23641] - Handle possible nulls if Git checkout fails

@jmoody 
Yes, this commit just improves the analysis of the issue. The build will fail if the situation happen.
See https://issues.jenkins-ci.org/browse/JENKINS-23641?focusedCommentId=213714&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-213714