diff --git a/common/framework/db.php b/common/framework/db.php index f5662a6fe..4002c4fc5 100644 --- a/common/framework/db.php +++ b/common/framework/db.php @@ -538,9 +538,9 @@ class DB throw new Exceptions\DBError($e->getMessage(), 0, $e); } - if ($result_type === 'auto' && $last_index === 0 && count($result) === 1) + if ($result_type === 'auto' && $last_index === 0 && count($result) <= 1) { - return $result[0]; + return isset($result[0]) ? $result[0] : null; } else {