From 1f652c8908b45895dc61911f9096465849890c29 Mon Sep 17 00:00:00 2001 From: SilverFire - Dmitry Naumenko Date: Fri, 27 Jan 2017 13:44:41 +0200 Subject: [PATCH] Fixed ActiveQuery::one() not to populate row when it is null --- src/ActiveQuery.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ActiveQuery.php b/src/ActiveQuery.php index 1aa27c6..6b88be8 100644 --- a/src/ActiveQuery.php +++ b/src/ActiveQuery.php @@ -250,6 +250,9 @@ public function one($db = null) } $row = $this->searchOne($db); + if ($row === null) { + return null; + } return reset($this->populate([$row])); }