Fix possible NPE uncovered when working on TISTUD-5844.