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
cacoos committed May 2, 2024
1 parent 8087d47 commit 24d3a66
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 @@ -59,7 +59,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 @@ -199,7 +199,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 24d3a66

Please sign in to comment.