Skip to content

Commit

Permalink
If we don't have the update time, we don't have valid Metar/TAF data.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Nov 5, 2016
1 parent 73ed419 commit d9d008d
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ protected function _parse(array $data)
$weatherData['update'] = strtotime(trim($data[0]) . ' GMT');
$weatherData['updateRaw'] = trim($data[0]);

if (empty($weatherData['update'])) {
throw new Horde_Service_Weather_Exception('Unable to parse data.');
}

// and prepare the rest for stepping through
array_shift($data);
$metar = explode(' ', preg_replace('/\s{2,}/', ' ', implode(' ', $data)));
Expand Down

0 comments on commit d9d008d

Please sign in to comment.