When building a .csproj file on Visual Studio 2022, I get these errors: Severity Code…
- User
When building a .csproj file on Visual Studio 2022, I get these errors:
Severity Code Description Project File Line Suppression State Details Warning (active) CS8602 Dereference of a possibly null reference. NxFileViewer C:\Users\Thomas\Nedlastinger\Firefox\NxFileViewer-renamer\src\NxFileViewer\Services\FileRenaming\FileRenamerService.cs 271
Severity Code Description Project File Line Suppression State Details Warning (active) CS8602 Dereference of a possibly null reference. NxFileViewer C:\Users\Thomas\Nedlastinger\Firefox\NxFileViewer-renamer\src\NxFileViewer\Services\FileRenaming\FileRenamerService.cs 274
Here is line 271:
partValue = partValue.ToLower();
And here is line 274:
partValue = partValue.ToUpper();
And here is an exempt of the whole file around where line 271 and 274 is used:
switch (dynamicText.StringOperator) { case StringOperator.Untouched: break; case StringOperator.ToLower: partValue = partValue.ToLower(); break; case StringOperator.ToUpper: partValue = partValue.ToUpper(); break; default: throw new ArgumentOutOfRangeException($"Unknown operator «{dynamicText.StringOperator}»."); }
- Assistant