Correct SqlResultProvider::fetchField() to work with empty results.

This commit is contained in:
Alexander Demidov
2013-12-24 10:00:51 +04:00
parent 7486ab5cf1
commit 94addf4ca9

View File

@ -76,7 +76,11 @@ class SqlResultProvider
*/ */
public function fetchField($field) public function fetchField($field)
{ {
return current($this->result_items)->{$field}; $item = current($this->result_items);
if ($item) {
return $item->{$field};
}
return false;
} }
public function fetch() public function fetch()