fix: bug when there's no host information, leading to a crash
This commit is contained in:
parent
d69dd19a0c
commit
a110cb86ed
1 changed files with 5 additions and 1 deletions
6
main.go
6
main.go
|
@ -317,7 +317,11 @@ func main() {
|
|||
json.Unmarshal(body, &broadcastResponse)
|
||||
showCard.SetTitle(broadcastResponse.Broadcast.NextShow.Show.Name)
|
||||
date := broadcastResponse.Broadcast.NextShow.Day + " " + broadcastResponse.Broadcast.NextShow.Date
|
||||
host := "by: " + broadcastResponse.Broadcast.NextShow.Show.Hosts[0].Name
|
||||
host := ""
|
||||
if len(broadcastResponse.Broadcast.NextShow.Show.Hosts) > 0 {
|
||||
host = "by: " + broadcastResponse.Broadcast.NextShow.Show.Hosts[0].Name
|
||||
} else {
|
||||
}
|
||||
showCard.SetSubTitle(date + " " + host)
|
||||
showAvatar.Image = loadImageURL(broadcastResponse.Broadcast.NextShow.Show.AvatarUrl)
|
||||
showAvatar.Refresh()
|
||||
|
|
Loading…
Reference in a new issue