Ugly NPE evasion. Solves the issue probably but why did it turn null even in the first place?