diff --git a/application/controllers/Api.php b/application/controllers/Api.php index 68ad31e21..b084ddf47 100644 --- a/application/controllers/Api.php +++ b/application/controllers/Api.php @@ -598,7 +598,7 @@ class API extends CI_Controller { // Get associated station locations for mysql queries $logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($logbook_id); - if (!$logbooks_locations_array) { + if ($logbooks_locations_array[0] == -1) { // Logbook not found http_response_code(404); echo json_encode(['status' => 'failed', 'reason' => "Empty Logbook"]); @@ -684,7 +684,7 @@ class API extends CI_Controller { // Get associated station locations for mysql queries $logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($logbook_id); - if (!$logbooks_locations_array) { + if ($logbooks_locations_array[0] == -1) { // Logbook not found http_response_code(404); echo json_encode(['status' => 'failed', 'reason' => "Empty Logbook"]);