Fix GeoService errors when viewing PIREP #498 (#499)

This commit is contained in:
Nabeel S
2020-01-15 09:09:58 -05:00
committed by GitHub
parent d4da0a6d6a
commit 7d07008871
2 changed files with 18 additions and 3 deletions

View File

@@ -267,6 +267,9 @@ class Pirep extends Model
$upper_bound = $this->planned_distance;
}
$upper_bound = empty($upper_bound) ? 1 : $upper_bound;
$distance = empty($distance) ? $upper_bound : $distance;
return round(($distance / $upper_bound) * 100, 0);
}