[Distances Worked] Small bugfix when no gridsquare found

这个提交包含在:
Andreas 2022-01-10 18:24:39 +01:00
父节点 c8f16d1a06
当前提交 87b287beea

查看文件

@ -22,7 +22,7 @@ class Distances_model extends CI_Model
$station_gridsquare = $this->find_gridsquare($station_id);
if ($station_gridsquare != "") {
if ($station_gridsquare != null) {
$gridsquare = explode(',', $station_gridsquare); // We need to convert to an array, since a user can enter several gridsquares
$this->db->select('col_call callsign, col_gridsquare grid');
@ -96,7 +96,14 @@ class Distances_model extends CI_Model
*/
function find_gridsquare($station_id) {
$this->db->where('station_id', $station_id);
return $this->db->get('station_profile')->row()->station_gridsquare;
$result = $this->db->get('station_profile')->row_array();
if ($result) {
return $result['station_gridsquare'];
}
return null;
}
// This functions takes query result from the database and extracts grids from the qso,