Fix null pointer dereference.