diff --git a/src/Features/Core/Portable/SpellCheck/AbstractSpellCheckCodeFixProvider.cs b/src/Features/Core/Portable/SpellCheck/AbstractSpellCheckCodeFixProvider.cs index b36b424b37f4f008895860c9e1b63fc950999b46..1f5340dd170623266c96d1a12eb389c0811fc360 100644 --- a/src/Features/Core/Portable/SpellCheck/AbstractSpellCheckCodeFixProvider.cs +++ b/src/Features/Core/Portable/SpellCheck/AbstractSpellCheckCodeFixProvider.cs @@ -37,7 +37,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) // Only bother with identifiers that are at least 3 characters long. // We don't want to be too noisy as you're just starting to type something. var nameText = name.GetFirstToken().ValueText; - if (nameText.Length >= 3) + if (nameText?.Length >= 3) { semanticModel = semanticModel ?? await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false); var symbolInfo = semanticModel.GetSymbolInfo(name, cancellationToken);