Skip to content
This repository was archived by the owner on Jul 13, 2026. It is now read-only.

Fix Warning CS8600: Converting null literal or possible null value to non-nullable type. - #107

Merged
jonpryor merged 1 commit into
mainfrom
null-fix
Mar 2, 2021
Merged

Fix Warning CS8600: Converting null literal or possible null value to non-nullable type.#107
jonpryor merged 1 commit into
mainfrom
null-fix

Conversation

@jpobst

@jpobst jpobst commented Feb 12, 2021

Copy link
Copy Markdown
Contributor

In #103 this line was added:

string ev = Environment.GetEnvironmentVariable (envVar);

With NRT, Environment.GetEnvironmentVariable returns string? instead of string, causing the warning:

Warning CS8600: Converting null literal or possible null value to non-nullable type.

We can avoid it by using var instead of string.

@jonpryor
jonpryor merged commit 554d45a into main Mar 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants