TRUNK-3970: Fix NPE