Skip to content

Commit

Permalink
Correctly handle CommandOrCodeAction with missing "command" property
Browse files Browse the repository at this point in the history
  • Loading branch information
tintoy committed Feb 13, 2020
1 parent c4fbf34 commit b622baa
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Command>());
}
Expand Down

0 comments on commit b622baa

Please sign in to comment.