The getAffectedFiles here can return an exception. For more information check this link. http://javadoc.jenkins-ci.org/hudson/scm/ChangeLogSet.Entry.html#getAffectedFiles()