fix crash if empty notification

botanswer
AnisB 4 years ago
parent cfc3d9e9b8
commit 2c2032237c

@ -276,7 +276,7 @@ func gethdlNotif(APIKey string, APIEndPoint string ) string {
fmt.Println("IS EMPTY: ", res.IsEmpty)
fmt.Println("res: ", res)
fmt.Println("res.Notifications: ", res.Notifications)
if (res.Notifications != nil) {
if (len(res.Notifications) > 0) {
fmt.Println("type of notif = ", reflect.TypeOf(res.Notifications[0]))
fmt.Println("Join: ", strings.Join([]string{res.Notifications[0].Title, res.Notifications[0].Body}, " "))
//fmt.Println("RESULT stirng(body)", string(body))

Loading…
Cancel
Save