Skip to content

Commit

Permalink
Always return an array
Browse files Browse the repository at this point in the history
Supersedes #144
  • Loading branch information
paragonie-security committed Jun 8, 2022
1 parent c93dac6 commit 03e7400
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/EasyDB.php
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,11 @@ public function row(string $statement, ...$params): array
true
);
if (is_array($result)) {
return array_shift($result);
$first = array_shift($result);
if (!is_array($first)) {
return [];
}
return $first;
}
return [];
}
Expand Down

0 comments on commit 03e7400

Please sign in to comment.