Skip to content

Commit

Permalink
Add an additional check to the Debug Bar integration to avoid trigger…
Browse files Browse the repository at this point in the history
…ing 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
  • Loading branch information
YahnisElsts committed Oct 20, 2023
1 parent 0f72961 commit 00774ef
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Puc/v5p2/UpdateChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,11 @@ protected function isBadDirectoryStructure($remoteSource) {
* 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();
}
}
Expand Down

0 comments on commit 00774ef

Please sign in to comment.