Browse Source

Do not crash if weather output is too short

master
Elis Hirwing 2 years ago
parent
commit
8f06b860fa
Signed by: etu <elis@hirwing.se> GPG Key ID: D57EFA625C9A925F
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      src/statusscreen/Weather.go

+ 5
- 1
src/statusscreen/Weather.go View File

@@ -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