diff --git a/views/default/toolbar.php b/views/default/toolbar.php
index <HASH>..<HASH> 100644
--- a/views/default/toolbar.php
+++ b/views/default/toolbar.php
@@ -23,7 +23,8 @@ if (window.localStorage) {
 }
 EOD;
 
-$url = $panels['request']->getUrl();
+$firstPanel = reset($panels);
+$url = $firstPanel->getUrl();
 ?>
 <div id="yii-debug-toolbar" class="yii-debug-toolbar-<?= $position ?>">
     <div class="yii-debug-toolbar-block">
use the url of the first panel as link, when toolbar is minimized