Code Analysis ReferenceAnalyzersRCS1202On this pageRCS1202: Avoid NullReferenceExceptionPropertiesPropertyValueDefault SeverityInfoMinimum language version-ExamplesExample #1diagnostic.csstring s = items.FirstOrDefault().ToString();fix.csstring s = items.FirstOrDefault()?.ToString();Applies toExtension for VS 2022Extension for VS CodeExtension for Open VSXPackage Roslynator.Analyzers