Skip to content

Commit

Permalink
Fixed ActiveQuery::one() not to populate row when it is null
Browse files Browse the repository at this point in the history
  • Loading branch information
SilverFire committed Jan 27, 2017
1 parent 9182f1d commit 1f652c8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ActiveQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,9 @@ public function one($db = null)
}

$row = $this->searchOne($db);
if ($row === null) {
return null;
}

return reset($this->populate([$row]));
}
Expand Down

0 comments on commit 1f652c8

Please sign in to comment.