Fix NPE introduced by changes