Skip to content

Commit

Permalink
Add guard against empty node in example
Browse files Browse the repository at this point in the history
  • Loading branch information
thegecko committed Jun 29, 2024
1 parent 716647e commit 8b870d6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ const provideHover = async (document: vscode.TextDocument, position: vscode.Posi

const ast: ASTNode | undefined = await api.languageClient.sendRequest(ASTRequestMethod, params);

if (!ast) {
return undefined;
}

return {
contents: [ast.kind]
};
Expand Down

0 comments on commit 8b870d6

Please sign in to comment.