-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
The initial state of MqttConnectionHandler can result in a NullReferenceException in the time between generic host starup and "full" startup. In my test environment this occurs consistently. For a workaround, I explicitly pull and inject the dependencies by calling StartAsync after building and prior to starting the host.
As I understand it, the connection should be terminated rather than remain unhandled in an invalid state.
public override async Task OnConnectedAsync(ConnectionContext connection)
{
...
var clientHandler = ClientHandler;
if (clientHandler != null)
{
await clientHandler(adapter).ConfigureAwait(false);
}
+ else
+ {
+ connection.Abort();
+ }
}Initially called out by @xljiulang in #2102 (comment)
Edited for clarity and to sync up to current master
Metadata
Metadata
Assignees
Labels
No labels