Access Violation Reading Location while checking for nullptr

How can I go about resolving this?