Skip to content

Commit ea17a88

Browse files
committed
Merge pull request #30 from phantom-d/master
Fix error 'Invalid argument supplied for foreach()' for method all() in ActiveQuery
2 parents d37c989 + 5357c77 commit ea17a88

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ActiveQuery.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ public function all($db = null)
116116
{
117117
// TODO add support for orderBy
118118
$data = $this->executeScript($db, 'All');
119+
if (empty($data)) {
120+
return [];
121+
}
119122
$rows = [];
120123
foreach ($data as $dataRow) {
121124
$row = [];

0 commit comments

Comments
 (0)