From 617813bdbfcefa7e81ca50d0574edcb64e7e291c Mon Sep 17 00:00:00 2001 From: "B.Fatih KOZ" <74361521+FatihKoz@users.noreply.github.com> Date: Tue, 9 Mar 2021 16:06:39 +0300 Subject: [PATCH] Fix Metar Decoding / Wind check for Wind Chill PR aims to fix the bug #1071 by checking both the wind speed and it's value for starting Wind Chill calculation. --- app/Support/Metar.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Support/Metar.php b/app/Support/Metar.php index 7f5635a2..25c573cf 100644 --- a/app/Support/Metar.php +++ b/app/Support/Metar.php @@ -1772,7 +1772,7 @@ class Metar implements \ArrayAccess */ private function calculate_wind_chill($temperature_f): void { - if ($temperature_f < 51 && $this->result['wind_speed'] !== 0) { + if ($temperature_f < 51 && $this->result['wind_speed'] && $this->result['wind_speed'] !== 0) { $windspeed = $this->result['wind_speed']->toUnit('mph'); if ($windspeed > 3) { $chill_f = 35.74 + 0.6215 * $temperature_f - 35.75 * ($windspeed ** 0.16);