From 4ee68301819c8a6ec44f875dedde411ce50b7ab6 Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Fri, 5 Jan 2018 14:33:22 -0600 Subject: [PATCH] Make sure the dpt airport is known before trying to parse the route --- app/Services/PIREPService.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Services/PIREPService.php b/app/Services/PIREPService.php index 61b51579..54e0e031 100644 --- a/app/Services/PIREPService.php +++ b/app/Services/PIREPService.php @@ -113,6 +113,11 @@ class PIREPService extends BaseService return $pirep; } + if(!$pirep->dpt_airport) { + Log::error('saveRoute: dpt_airport not found: '.$pirep->dpt_airport_id); + return $pirep; + } + $route = $this->geoSvc->getCoordsFromRoute( $pirep->dpt_airport_id, $pirep->arr_airport_id,