TRUNK-4392 Added nullsafe check