Do not crash if weather output is too short

master
Elis Hirwing 5 years ago
parent a726e83ca6
commit 8f06b860fa
Signed by: etu
GPG Key ID: D57EFA625C9A925F
  1. 6
      src/statusscreen/Weather.go

@ -29,7 +29,11 @@ func (weather *Weather) GetOutput() []string {
parts := strings.Split(weather.lastResponse, "\n")
return parts[:len(parts)-5]
if len(parts) > 6 {
return parts[:len(parts)-5]
}
return []string{}
}
func (weather *Weather) getWeather() (string, error) {

Loading…
Cancel
Save