Don't enrich nil updates

This commit is contained in:
Ryan McGuire 2025-01-05 17:36:39 -05:00
parent 96dfcf7e53
commit be8a4f3bca

View File

@ -5,6 +5,10 @@ import "math"
// Attempts to complete missing fields that may not
// be set by a specific provider, such as DewPoint and WindChill
func (u *WeatherUpdate) Enrich() {
if u == nil {
return
}
if u.WindChillF == 0 {
u.WindChillF = CalculateWindChill(u.TempOutdoorF, u.WindSpeedMPH)
}