From e3a000af4100a0f8614dc75cd08e7de06c041b0f Mon Sep 17 00:00:00 2001 From: Kelly Banman Date: Sat, 11 Aug 2012 15:52:58 -0700 Subject: [PATCH] Fix Query::lists() for empty resultsets --- laravel/database/query.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) {