1
0

In index.pug avoid nil pointer dereferencing.

This commit is contained in:
Alexander Andreev 2023-10-07 05:35:16 +04:00
parent b8afed6e1b
commit 65ec8c1db2
Signed by: Arav
GPG Key ID: D22A817D95815393

View File

@ -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
if (songList.Current() != nil)
- cur := *songList.Current()
if (cur.Artist != "")
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 ] )