Check for null pointer dereference