[Fixed JENKINS-25313] fix null pointer exception when last repo or branch deleted