Fix Query::lists() for empty resultsets

This commit is contained in:
Kelly Banman 2012-08-11 15:52:58 -07:00
parent 1bd157d0a6
commit e3a000af41
1 changed files with 1 additions and 1 deletions

View File

@ -605,7 +605,7 @@ public function lists($column, $key = null)
// set the keys on the array of values using the array_combine // set the keys on the array of values using the array_combine
// function provided by PHP, which should give us the proper // function provided by PHP, which should give us the proper
// array form to return from the method. // 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) return array_combine(array_map(function($row) use ($key)
{ {