Fixed issue #1414
This commit is contained in:
parent
40cc827d3d
commit
a74f0c2af0
@ -124,10 +124,22 @@ class FlightImporter extends ImportExport
|
||||
}
|
||||
|
||||
// Create/check that they exist
|
||||
$this->processAirport($row['dpt_airport']);
|
||||
$this->processAirport($row['arr_airport']);
|
||||
$process_dep = $this->processAirport($row['dpt_airport']);
|
||||
if (is_null($process_dep)) {
|
||||
$this->log('Could not import row '.$index.'. Departure Airport not found!');
|
||||
return false;
|
||||
}
|
||||
$process_arr = $this->processAirport($row['arr_airport']);
|
||||
if (is_null($process_arr)) {
|
||||
$this->log('Could not import row '.$index.'. Arrival Airport not found!');
|
||||
return false;
|
||||
}
|
||||
if ($row['alt_airport']) {
|
||||
$this->processAirport($row['alt_airport']);
|
||||
$process_alt = $this->processAirport($row['alt_airport']);
|
||||
if (is_null($process_alt)) {
|
||||
$this->log('Could not import row '.$index.'. Alternate Airport not found!');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Check/calculate the distance
|
||||
@ -198,7 +210,7 @@ class FlightImporter extends ImportExport
|
||||
*
|
||||
* @return Airport
|
||||
*/
|
||||
protected function processAirport($airport): Airport
|
||||
protected function processAirport($airport): Airport|null
|
||||
{
|
||||
return $this->airportSvc->lookupAirportIfNotFound($airport);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user