Commit bf489d87 authored by chandi's avatar chandi Committed by Matthias Larisch

fixed type error when conversations list is empty

parent f471f67a
Pipeline #48562515 canceled with stages
......@@ -31,7 +31,8 @@ final class MessageControl extends Control
$this->func->addContent($this->view->conversation());
$this->func->addContent($this->view->leftMenu(), CNT_RIGHT);
if ($conversations = $this->model->listConversations()) {
$conversations = $this->model->listConversations();
if ($conversations) {
$ids = array();
foreach ($conversations as $c) {
$ids[$c['id']] = true;
......
......@@ -224,13 +224,13 @@ final class MessageModel extends Db
* @param int $limit
* @param int $offset
*
* @return array|bool
* @return array
*/
public function listConversations(int $limit = -1, int $offset = 0)
{
$paginate = '';
if ($limit !== -1) {
$paginate = ' LIMIT ' . $offset . ',' . $limit;
$paginate = ' LIMIT ' . (int)$offset . ',' . (int)$limit;
}
if ($conversations = $this->q('
......@@ -275,7 +275,7 @@ final class MessageModel extends Db
return $conversations;
}
return false;
return [];
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment