Fixed bug with NPE in case of empty tools list (JENKINS-18481)