Skip to content

Commit 62f5612

Browse files
jafaripurcebe
authored andcommitted
Fix error of debug page
Error occurred when $messages variable is null and this exception throw: Invalid argument supplied for foreach() close #73
1 parent e9e3430 commit 62f5612

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Yii Framework 2 elasticsearch extension Change Log
1010
- Bug #19: `DeleteAll` now deletes all entries, not first 10 (beowulfenator)
1111
- Bug #48: `UpdateAll` now updates all entries, not first 10 (beowulfenator)
1212
- Bug #65: Fixed warning `array to string conversion` when parsing error response (rhertogh, silverfire)
13+
- Bug #73: Fixed debug panel exception when no data was recorded for elasticsearch panel (jafaripur)
1314
- Enh #2: Added `min_score` option to query (knut)
1415
- Enh #28: AWS Elasticsearch service compatibility (andrey-bahrachev)
1516
- Enh #33: Implemented `Command::updateSettings()` and `Command::updateAnalyzers()` (githubjeka)

DebugPanel.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public function calculateTimings()
157157
if ($this->_timings !== null) {
158158
return $this->_timings;
159159
}
160-
$messages = $this->data['messages'];
160+
$messages = isset($this->data['messages']) ? $this->data['messages'] : [];
161161
$timings = [];
162162
$stack = [];
163163
foreach ($messages as $i => $log) {

0 commit comments

Comments
 (0)