deepgram / deepgram-dotnet-sdk

.NET SDK for Deepgram's automated speech recognition APIs.
https://developers.deepgram.com
MIT License
28 stars 32 forks source link

LiveClient.IsConnection() throws NullReferenceException when called without websocket client instance. #296

Closed acidbubbles closed 2 months ago

acidbubbles commented 3 months ago

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.

dvonthenen commented 3 months ago

Hi @acidbubbles

Nice catch. Will fix this when I get back to .NET.

dvonthenen commented 2 months ago

Will be available in the 4.1 release.