Преглед на файлове

Restore null check in get_status_response()

Prevents crash when called without active connection.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
tuanchris преди 1 седмица
родител
ревизия
2f29ac10ed
променени са 1 файла, в които са добавени 4 реда и са изтрити 0 реда
  1. 4 0
      modules/connection/connection_manager.py

+ 4 - 0
modules/connection/connection_manager.py

@@ -391,6 +391,10 @@ def get_status_response() -> str:
     """
     Send a status query ('?') and return the response if available.
     """
+    if state.conn is None or not state.conn.is_connected():
+        logger.warning("Cannot get status response: no active connection")
+        return False
+
     while True:
         try:
             state.conn.send('?')