Skip to content

Commit 089afec

Browse files
cxongseratch
authored andcommitted
Fix aiohttp SocketModeClient.is_connected AttributeError in detailed logging
In a new aiohttp SocketModeClient, when self.current_session is None, calling is_connected and going into the detailed logging section will attempt to access self.current_session.closed and lead to an AttributeError
1 parent 352cb23 commit 089afec

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
@@ -332,7 +332,7 @@ async def is_connected(self) -> bool:
332332
f"session_id: {session_id}, "
333333
f"closed: {self.closed}, "
334334
f"stale: {self.stale}, "
335-
f"current_session.closed: {self.current_session.closed}, "
335+
f"current_session.closed: {self.current_session and self.current_session.closed}, "
336336
f"is_ping_pong_failing: {is_ping_pong_failing}"
337337
")"
338338
)

0 commit comments

Comments
 (0)