Do not crash if weather output is too short
parent
a726e83ca6
commit
8f06b860fa
|
@ -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…
Reference in New Issue