Check for nullptr after getenv.