Skip to content

Commit

Permalink
fix(channels/generic): ensure text message exists before deciding to …
Browse files Browse the repository at this point in the history
…handle
  • Loading branch information
cacosandon committed Sep 3, 2024
1 parent 3ea0817 commit dc290fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions channels/generic/websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def websocket_receive(self, message):
Called when a WebSocket frame is received. Decodes it and passes it
to receive().
"""
if "text" in message:
if "text" in message and message["text"] is not None:
self.receive(text_data=message["text"])
else:
self.receive(bytes_data=message["bytes"])
Expand Down Expand Up @@ -200,7 +200,7 @@ async def websocket_receive(self, message):
Called when a WebSocket frame is received. Decodes it and passes it
to receive().
"""
if "text" in message:
if "text" in message and message["text"] is not None:
await self.receive(text_data=message["text"])
else:
await self.receive(bytes_data=message["bytes"])
Expand Down

0 comments on commit dc290fb

Please sign in to comment.