Skip to content

Commit

Permalink
fix $rows issue
Browse files Browse the repository at this point in the history
  • Loading branch information
rabol committed Mar 11, 2022
1 parent a438288 commit 3f72dcc
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/Models/LogFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,17 @@ public function getRows()
{
$logFiles = LogReader::getLogFilenameList();
$i = 1;
foreach ($logFiles as $key => $value) {
$rows[] =[
'id' => $i++,
'name' => $key,
'path' => $value,
];
if($logFiles)
{
foreach ($logFiles as $key => $value) {
$rows[] =[
'id' => $i++,
'name' => $key,
'path' => $value,
];
}
} else {
$rows = [];
}

return $rows;
Expand Down

0 comments on commit 3f72dcc

Please sign in to comment.