diff --git a/CHANGELOG.md b/CHANGELOG.md index 14a43d1..f3d88d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# Version 3.0.2 + +* Guarantee that `EasyDB::row()` always returns an `array` instead of throwing + a `TypeError` when encountering `null`. + See also: [#144](https://github.com/paragonie/easydb/pull/144). + # Version 3.0.1 * [#143](https://github.com/paragonie/easydb/issues/143): diff --git a/src/EasyDB.php b/src/EasyDB.php index cdb42f0..43a0e1d 100644 --- a/src/EasyDB.php +++ b/src/EasyDB.php @@ -1003,6 +1003,7 @@ public function row(string $statement, ...$params): array if (is_array($result)) { $first = array_shift($result); if (!is_array($first)) { + /* Do not TypeError on empty results */ return []; } return $first;