From 40bdea5baa73a799c18e3603dd003d962cc7e018 Mon Sep 17 00:00:00 2001 From: Cong Date: Wed, 22 May 2024 16:27:15 +1000 Subject: [PATCH] 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 --- slack_sdk/socket_mode/aiohttp/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slack_sdk/socket_mode/aiohttp/__init__.py b/slack_sdk/socket_mode/aiohttp/__init__.py index d6ccf12c..9a8b21cd 100644 --- a/slack_sdk/socket_mode/aiohttp/__init__.py +++ b/slack_sdk/socket_mode/aiohttp/__init__.py @@ -332,7 +332,7 @@ async def is_connected(self) -> bool: f"session_id: {session_id}, " f"closed: {self.closed}, " f"stale: {self.stale}, " - f"current_session.closed: {self.current_session.closed}, " + f"current_session.closed: {self.current_session and self.current_session.closed}, " f"is_ping_pong_failing: {is_ping_pong_failing}" ")" )