diff --git a/src/Protocol/Serialization/Converters/CommandOrCodeActionConverter.cs b/src/Protocol/Serialization/Converters/CommandOrCodeActionConverter.cs index d0f304583..2e6e41eff 100644 --- a/src/Protocol/Serialization/Converters/CommandOrCodeActionConverter.cs +++ b/src/Protocol/Serialization/Converters/CommandOrCodeActionConverter.cs @@ -28,7 +28,8 @@ public override CommandOrCodeAction ReadJson(JsonReader reader, Type objectType, var result = JObject.Load(reader); // Commands have a name, CodeActions do not - if (result["command"].Type == JTokenType.String) + JToken command = result["command"]; + if (command?.Type == JTokenType.String) { return new CommandOrCodeAction(result.ToObject()); }