Make comparisons null-safe