Skip to content

Commit 412dc4f

Browse files
Avoid nullref
1 parent 6cca464 commit 412dc4f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Vsix/VisualStudioInteraction.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ public static async Task WriteStatusBarTextAsync(IAsyncServiceProvider servicePr
169169
var span = await GetFirstSelectedSpanInCurrentViewAsync(asyncServiceProvider, predicate, mustHaveFocus);
170170
var currentViewHostAsync =
171171
await GetCurrentViewHostAsync(asyncServiceProvider, predicate, mustHaveFocus);
172+
if (currentViewHostAsync == null) return (null, null);
172173
using (var textDocumentAsync = await currentViewHostAsync.GetTextDocumentAsync())
173174
{
174175
var result = (textDocumentAsync?.FilePath, span);

0 commit comments

Comments
 (0)