Fix invalid result count if search request returns no records (Bug #3013)

This commit is contained in:
Aleksander Machniak 2014-04-24 15:23:41 +02:00
parent e987e51af2
commit 68e7adfa04

View file

@ -338,7 +338,7 @@ class rcube_kolab_contacts extends rcube_addressbook
} }
} }
else { else {
$this->result->count = $this->storagefolder->count($query); $this->result->count = isset($query) ? $this->storagefolder->count($query) : 0;
foreach ($this->dataset as $idx => $record) { foreach ($this->dataset as $idx => $record) {
$this->result->add($this->_to_rcube_contact($record)); $this->result->add($this->_to_rcube_contact($record));
} }