Skip to content

Commit c8cca33

Browse files
authored
Merge pull request #211 from tintoy/bug/command-or-code-action
Correctly handle CommandOrCodeAction with missing "command" property
2 parents c4fbf34 + b622baa commit c8cca33

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Protocol/Serialization/Converters/CommandOrCodeActionConverter.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ public override CommandOrCodeAction ReadJson(JsonReader reader, Type objectType,
2828
var result = JObject.Load(reader);
2929

3030
// Commands have a name, CodeActions do not
31-
if (result["command"].Type == JTokenType.String)
31+
JToken command = result["command"];
32+
if (command?.Type == JTokenType.String)
3233
{
3334
return new CommandOrCodeAction(result.ToObject<Command>());
3435
}

0 commit comments

Comments
 (0)