Skip to content

Commit

Permalink
Additional check for exceptions (#1632)
Browse files Browse the repository at this point in the history
Try to avoid internal exceptions from aiohttp in `message_data`
  • Loading branch information
lingfish authored Jan 13, 2025
1 parent 86169db commit 8257c27
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion slack_sdk/socket_mode/aiohttp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ async def receive_messages(self) -> None:
message_data = message.data
if isinstance(message_data, bytes):
message_data = message_data.decode("utf-8")
if message_data is not None and len(message_data) > 0:
if message_data is not None and isinstance(message_data, (str, bytes)) and len(message_data) > 0:
# To skip the empty message that Slack server-side often sends
self.logger.debug(
f"Received message "
Expand Down

0 comments on commit 8257c27

Please sign in to comment.