From bfcdcdc4f111022fe567628e6a5ce529671673f2 Mon Sep 17 00:00:00 2001 From: Pravesh Sharma Date: Thu, 18 Jul 2024 14:24:50 +0530 Subject: [PATCH] Add a precautionary check for the query tool connection cursor to fix the error 'NoneType' object has no attribute '_query'. #7660 --- web/pgadmin/tools/sqleditor/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/pgadmin/tools/sqleditor/__init__.py b/web/pgadmin/tools/sqleditor/__init__.py index 478888013..f9f02a23f 100644 --- a/web/pgadmin/tools/sqleditor/__init__.py +++ b/web/pgadmin/tools/sqleditor/__init__.py @@ -988,8 +988,8 @@ def poll(trans_id): query_len_data = { 'transaction_status': transaction_status, 'explain_query_length': - get_explain_query_length( - conn._Connection__async_cursor._query) + get_explain_query_length(conn._Connection__async_cursor._query) + if conn._Connection__async_cursor else 0 } return internal_server_error(result, query_len_data) elif status == ASYNC_OK: