[JENKINS-25312] - Prevent NPE if build has not been finished yet

May appear if somebody calls the publisher using AnyBuildStep

Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>