Fix potential null dereference.