Fix NPE (WI-22515).
(cherry picked from commit 84a28b9)