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
This commit is contained in:
Yahnis Elsts 2023-10-20 16:40:52 +03:00
parent 0f7296123e
commit 00774ef3d9
1 changed files with 5 additions and 1 deletions

View File

@ -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();
}
}