Skip to content

NullReferenceException when setting null Uri into ConnectionFactory #1622

Closed
@lechu445

Description

@lechu445

Describe the bug

It is not clear if ConnectionFactory can have null Uri property. If ConnectionFactory is created via constructor, Uri property returns null. But, ConnectionFactory does not allow explicit set null Uri.

Reproduction steps

Simple reproduction:

using RabbitMQ.Client;

var c = new ConnectionFactory();

Console.WriteLine(c.Uri == null); // prints True

c.Uri = null; // throws NullReferenceException

Expected behavior

NullReferenceException is not thrown.

Additional context

This issue was detected by Roslyn analyzer during work on #1596.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions