Skip to content

Commit

Permalink
Do not return an error if there are no threads. Just an empty array.
Browse files Browse the repository at this point in the history
  • Loading branch information
martindrapeau committed Sep 27, 2013
1 parent b5581ee commit 10c5e82
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions application/libraries/Mahana_messaging.php
Expand Up @@ -111,7 +111,8 @@ function get_all_threads($user_id, $full_thread = FALSE, $order_by = 'ASC')
return $this->_invalid_id(MSG_ERR_INVALID_USER_ID);
}

if ($message = $this->ci->mahana_model->get_all_threads($user_id, $full_thread, $order_by))
$message = $this->ci->mahana_model->get_all_threads($user_id, $full_thread, $order_by);
if (is_array($message))
{
return $this->_success($message);
}
Expand All @@ -138,7 +139,8 @@ function get_all_threads_grouped($user_id, $full_thread = FALSE, $order_by = 'AS
return $this->_invalid_id(MSG_ERR_INVALID_USER_ID);
}

if ($message = $this->ci->mahana_model->get_all_threads($user_id, $full_thread, $order_by))
$message = $this->ci->mahana_model->get_all_threads($user_id, $full_thread, $order_by);
if (is_array($message))
{
$threads = array();

Expand Down

0 comments on commit 10c5e82

Please sign in to comment.