Skip to content

Commit

Permalink
fixed a bug about receiving package
Browse files Browse the repository at this point in the history
  • Loading branch information
kerryjiang committed May 25, 2024
1 parent f097935 commit 696e7b5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/WebSocket4Net/WebSocket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ public async ValueTask<WebSocketPackage> ReceiveAsync(bool returnControlPackage)
{
var package = await base.ReceiveAsync();

if (package == null)
return null;

if (package.OpCode != OpCode.Binary && package.OpCode != OpCode.Text && package.OpCode != OpCode.Handshake)
{
await HandleControlPackage(package);
Expand Down

0 comments on commit 696e7b5

Please sign in to comment.