Fixed possilbe NPE introduced in re. 98ae55f