Skip to content

Commit

Permalink
Merge pull request #211 from tintoy/bug/command-or-code-action
Browse files Browse the repository at this point in the history
Correctly handle CommandOrCodeAction with missing "command" property
  • Loading branch information
tintoy authored Feb 13, 2020
2 parents c4fbf34 + b622baa commit c8cca33
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 c8cca33

Please sign in to comment.