Kaynağa Gözat

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 hafta önce
ebeveyn
işleme
2f29ac10ed
1 değiştirilmiş dosya ile 4 ekleme ve 0 silme
  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('?')