Skip to content

Panic on Calling Drain on a nil NATS Connection #1562

@mrazimi99

Description

@mrazimi99

Observed behavior

When Drain is called on a NATS connection object and it is nil, the program panics; while calling Drain on a Subscription does not lead to a panic and returns error.

Expected behavior

I expect that calling Drain() on a NATS connection, an error be returned, instead of panic.

Server and client version

v1.32.0

Host environment

No response

Steps to reproduce

Create a NATS connection with an invalid URL, and the call Drain() on it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    defectSuspected defect such as a bug or regression

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions