Guarded against null pointer exceptions.