Guard against null pointers.