From 05f23436ac76d5c2e38793db8d45b250ebb26c11 Mon Sep 17 00:00:00 2001 From: Marc Aymerich Gunern Date: Thu, 18 Apr 2024 12:16:43 +0100 Subject: [PATCH] Prevent LookupError when accessing debug_toolbars_var when toolbar is being disabled in the middle of a request --- src/flask_debugtoolbar/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/flask_debugtoolbar/__init__.py b/src/flask_debugtoolbar/__init__.py index 95746ac..20f9ee2 100644 --- a/src/flask_debugtoolbar/__init__.py +++ b/src/flask_debugtoolbar/__init__.py @@ -196,7 +196,7 @@ def process_view(self, app, view_func, view_kwargs): def process_response(self, response): real_request = request._get_current_object() - if real_request not in self.debug_toolbars_var.get(): + if real_request not in self.debug_toolbars_var.get({}): return response # Intercept http redirect codes and display an html page with a