diff --git a/laravel/database/query.php b/laravel/database/query.php index c77ad65b..82a827e3 100644 --- a/laravel/database/query.php +++ b/laravel/database/query.php @@ -605,7 +605,7 @@ public function lists($column, $key = null) // set the keys on the array of values using the array_combine // function provided by PHP, which should give us the proper // array form to return from the method. - if ( ! is_null($key)) + if ( ! is_null($key) && count($results)) { return array_combine(array_map(function($row) use ($key) {