Fix lookups for empty contest sessions

This commit is contained in:
phl0
2023-11-09 15:11:36 +01:00
parent 19f01dd393
commit 83b3261034
2 changed files with 2 additions and 2 deletions

View File

@@ -188,7 +188,7 @@ class Contesting extends CI_Controller {
$result = $this->Contesting_model->checkIfWorkedBefore($call, $band, $mode, $contest);
header('Content-Type: application/json');
if ($result->num_rows()) {
if ($result && $result->num_rows()) {
echo json_encode(array('message' => 'Worked before'));
}
return;

View File

@@ -214,7 +214,7 @@ class Contesting_model extends CI_Model {
$contest_session = $this->getSession();
if ($contest_session) {
if ($contest_session && $contest_session->qso != "") {
$qsoarray = explode(',', $contest_session->qso);
$date = DateTime::createFromFormat('d-m-Y H:i:s', $qsoarray[0]);