Skip to content

Commit 8257c27

Browse files
authored
Additional check for exceptions (#1632)
Try to avoid internal exceptions from aiohttp in `message_data`
1 parent 86169db commit 8257c27

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

slack_sdk/socket_mode/aiohttp/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ async def receive_messages(self) -> None:
241241
message_data = message.data
242242
if isinstance(message_data, bytes):
243243
message_data = message_data.decode("utf-8")
244-
if message_data is not None and len(message_data) > 0:
244+
if message_data is not None and isinstance(message_data, (str, bytes)) and len(message_data) > 0:
245245
# To skip the empty message that Slack server-side often sends
246246
self.logger.debug(
247247
f"Received message "

0 commit comments

Comments
 (0)