Skip to content

NullReferenceException during disconnection - #337

Merged
tomaszgolebiowski merged 1 commit into
mainfrom
tg/null-during-disconnect
Aug 7, 2025
Merged

NullReferenceException during disconnection#337
tomaszgolebiowski merged 1 commit into
mainfrom
tg/null-during-disconnect

Conversation

@tomaszgolebiowski

Copy link
Copy Markdown
Contributor

An exception is thrown when closing VS and disconnecting from the agent. This PR gives a condition that checks if the object is not null.

Test plan

N/A

@github-actions

github-actions Bot commented Aug 6, 2025

Copy link
Copy Markdown

Test Results

27 tests  +27   20 ✅ +20   1m 53s ⏱️ + 1m 53s
 1 suites + 1    7 💤 + 7 
 1 files   + 1    0 ❌ ± 0 

Results for commit 13f5f38. ± Comparison against base commit e2bdafc.

private void DisconnectInternal()
{
if (!jsonRpc.IsDisposed) jsonRpc?.Dispose();
if (jsonRpc != null && !jsonRpc.IsDisposed) jsonRpc?.Dispose();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jsonRpc?.Dispose();

could be simplified to:

jsonRpc.Dispose();

@tomaszgolebiowski
tomaszgolebiowski merged commit 07f7672 into main Aug 7, 2025
7 checks passed
@tomaszgolebiowski
tomaszgolebiowski deleted the tg/null-during-disconnect branch August 7, 2025 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants