In index.pug avoid nil pointer dereferencing.
This commit is contained in:
parent
b8afed6e1b
commit
65ec8c1db2
@ -45,8 +45,8 @@ html(lang='en')
|
||||
source(src='/live/stream.ogg' type='audio/ogg')
|
||||
| Your browser doesn't support an audio element, it's sad... But you always can take the #[a(href='/playlist') playlist]!
|
||||
div
|
||||
- cur := *songList.Current()
|
||||
if (cur.Artist != "")
|
||||
if (songList.Current() != nil)
|
||||
- cur := *songList.Current()
|
||||
p Now playing: #[span#radio-song #{cur.ArtistTitle()}] ( #[span#radio-duration-estimate ] #[span#radio-duration #{cur.DurationString()}] )
|
||||
else
|
||||
p Now playing: #[span#radio-song ] ( #[span#radio-duration-estimate ] #[span#radio-duration ] )
|
||||
|
Loading…
Reference in New Issue
Block a user