Skip to content

Commit b4e82d6

Browse files
committed
Fix a nullref in CodeLensHandler when a node doesn't have a title
1 parent cf1e213 commit b4e82d6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

YarnSpinner.LanguageServer/src/Server/Handlers/CodeLensHandler.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ public Task<CodeLensContainer> Handle(CodeLensParams request, CancellationToken
3434
var results = yarnFile.NodeInfos.SelectMany(nodeInfo =>
3535
{
3636
var titleToken = nodeInfo.TitleToken;
37-
if (titleToken.StartIndex == -1)
37+
38+
if (titleToken == null || titleToken.StartIndex == -1)
3839
{
3940
// This is an error token - the node doesn't actually
4041
// have a valid title. Return an empty collection of code

0 commit comments

Comments
 (0)