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