sshnet / sshnet/SSH.NET

NetConfClient null exception when PW incorrect

Open Beginner friendly
#385 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
4.4k
Forks
993
Avg merge
9d 21h
Merged PRs (30d)
1

Description

On the stack I saw the Password Exception, but what was returned was a null object reference from here:

    protected override void OnDisconnecting()
    {
        base.OnDisconnecting();

        _netConfSession.Disconnect();    //_netConfSession is null
    }

adding a null check passes me the correct exception

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at NetConfClient.OnDisconnecting and reproduce a connection attempt with an incorrect password. Trace the password exception through disconnect handling and verify that the reported exception is preserved instead of being replaced by a null object reference. Done means the incorrect-password case returns the expected exception without causing a null-reference failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
networking
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.