Skip to content

Commit

Permalink
改进convertObjectID方法
Browse files Browse the repository at this point in the history
  • Loading branch information
liu21st committed Aug 20, 2018
1 parent ce641c8 commit 4e01004
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ protected function getResult($class = '', $typeMap = null)
*/
private function convertObjectID(&$data)
{
if (isset($data['_id'])) {
if (isset($data['_id']) && is_object($data['_id'])) {
$data['id'] = $data['_id']->__toString();
unset($data['_id']);
}
Expand Down

0 comments on commit 4e01004

Please sign in to comment.