From 60bbd5b8b530af7b7d4acfa2bb656331b037c0fe Mon Sep 17 00:00:00 2001 From: Alma Armas Date: Wed, 21 Apr 2021 11:35:31 +0000 Subject: [PATCH] Fix error in DatabasePanel --- chandler/Debug/DatabasePanel.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/chandler/Debug/DatabasePanel.php b/chandler/Debug/DatabasePanel.php index ad437ea..7a900a7 100644 --- a/chandler/Debug/DatabasePanel.php +++ b/chandler/Debug/DatabasePanel.php @@ -8,10 +8,15 @@ class DatabasePanel implements \Tracy\IBarPanel public function getTab() { - $count = sizeof($GLOBALS["dbgSqlQueries"]); - $time = ceil($GLOBALS["dbgSqlTime"] * 1000); - $svg = file_get_contents(__DIR__ . "/templates/db-icon.svg"); - + if(isset($GLOBALS["dbgSqlQueries"])) { + $count = sizeof($GLOBALS["dbgSqlQueries"]); + $time = ceil($GLOBALS["dbgSqlTime"] * 1000); + } else { + $count = "No"; + $time = 0; + } + + $svg = file_get_contents(__DIR__ . "/templates/db-icon.svg"); return << $svg @@ -22,6 +27,9 @@ EOF; public function getPanel() { + if(!isset($GLOBALS["dbgSqlQueries"])) + return "No queries were made..."; + $html = <<Queries:
@@ -38,4 +46,4 @@ HTML; return $html; } -} \ No newline at end of file +}