deepgram-dotnet-sdk
deepgram-dotnet-sdk copied to clipboard
LiveClient.IsConnection() throws NullReferenceException when called without websocket client instance.
trafficstars
What is the current behavior?
NullReferenceException
Steps to reproduce
var live = new LiveClient();
var _ = live.IsConnected(); // This throws because _clientWebSocket can be null
Expected behavior
false
Please tell us about your environment
Not related
Other information
I would recommend you enable <Nullable>enable</Nullable> on the project, this one would have been easily detected :)
Also, I can receive that same error after calling Connect. Probably because of KeepAlive but I didn't investigate more.
Hi @acidbubbles
Nice catch. Will fix this when I get back to .NET.
Will be available in the 4.1 release.