diff --git a/app/Console/Commands/Grapper/TxOdds/Odds.php b/app/Console/Commands/Grapper/TxOdds/Odds.php index ce5e146f..1df6ea91 100644 --- a/app/Console/Commands/Grapper/TxOdds/Odds.php +++ b/app/Console/Commands/Grapper/TxOdds/Odds.php @@ -320,7 +320,7 @@ class Odds case 'starting_time': $res = EventBookmaker::where('event_id', $event_id)->where('bookmaker_id', $bookmaker_id)->first(); - if ($res->starttime != $attributeValue) { + if ($res && $res->starttime != $attributeValue) { $res->starttime = $attributeValue; DatabaseFunctions::save_update($res); } @@ -336,7 +336,7 @@ class Odds case 'starting_time': $res = EventBookmaker::where('event_id', $event_id)->where('bookmaker_id', $bookmaker_id)->first(); - if ($res->starttime != $attributeValue) { + if ($res && $res->starttime != $attributeValue) { $res->starttime = $attributeValue; DatabaseFunctions::save_update($res); } @@ -352,7 +352,7 @@ class Odds case 'starting_time': $res = EventBookmaker::where('event_id', $event_id)->where('bookmaker_id', $bookmaker_id)->first(); - if ($res->starttime != $attributeValue) { + if ($res && $res->starttime != $attributeValue) { $res->starttime = $attributeValue; DatabaseFunctions::save_update($res); }