From 6116c1d9b7e64da368d1a1de1e6a54e8809b162d Mon Sep 17 00:00:00 2001 From: Elara Musayelyan Date: Mon, 21 Aug 2023 21:37:40 -0700 Subject: [PATCH] Fix issue where a sky condition without an altitude broke the interpreter --- taf.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/taf.go b/taf.go index de78e21..6b5462f 100644 --- a/taf.go +++ b/taf.go @@ -107,9 +107,12 @@ func ParseWithOptions(r io.Reader, opts Options) (*Forecast, error) { Precipitation: Precipitation(item.Vicinity.Precipitation), }) case item.SkyCondition != nil: - altitude, err := strconv.Atoi(item.SkyCondition.Altitude) - if err != nil { - return nil, participle.Errorf(item.SkyCondition.Pos, "sky: %s", err) + var altitude int + if item.SkyCondition.Altitude != "" { + altitude, err = strconv.Atoi(item.SkyCondition.Altitude) + if err != nil { + return nil, participle.Errorf(item.SkyCondition.Pos, "sky: %s", err) + } } appendField(out, "SkyCondition", SkyCondition{