From 00774ef3d9a2a3dfd8ac040b0dcdf5e42126a708 Mon Sep 17 00:00:00 2001 From: Yahnis Elsts Date: Fri, 20 Oct 2023 16:40:52 +0300 Subject: [PATCH] Add an additional check to the Debug Bar integration to avoid triggering a fatal error in the unusual situation where `Debug_Bar` exists and `Debug_Bar_Panel` does not. This should never happen with the Debug Bar plugin itself. However, it's apparently possible if Query Monitor is involved. See #543 --- Puc/v5p2/UpdateChecker.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Puc/v5p2/UpdateChecker.php b/Puc/v5p2/UpdateChecker.php index 6a4ab27..d97048e 100644 --- a/Puc/v5p2/UpdateChecker.php +++ b/Puc/v5p2/UpdateChecker.php @@ -980,7 +980,11 @@ if ( !class_exists(UpdateChecker::class, false) ): * Initialize the update checker Debug Bar plugin/add-on thingy. */ public function maybeInitDebugBar() { - if ( class_exists('Debug_Bar', false) && file_exists(dirname(__FILE__) . '/DebugBar') ) { + if ( + class_exists('Debug_Bar', false) + && class_exists('Debug_Bar_Panel', false) + && file_exists(dirname(__FILE__) . '/DebugBar') + ) { $this->debugBarExtension = $this->createDebugBarExtension(); } }