X-Git-Url: https://git.wh0rd.org/?p=chrome-ext%2Fmusic-player-client.git;a=blobdiff_plain;f=main.js;h=1e83a3b2b6c0b996f34e4b30e12478ccea15554d;hp=7e12e9fe4948b04d5d10b512e84475bd252753d8;hb=a7204fc7d572e685cf591ccc941c35f8ff7cf322;hpb=0c6612195aad9b50879223c510e47df0725ec6d4 diff --git a/main.js b/main.js index 7e12e9f..1e83a3b 100644 --- a/main.js +++ b/main.js @@ -239,7 +239,12 @@ function update_ui(state, cmd) { return; } - var time = state.time.split(':'); + var time; + if ('time' in state) + // When stopped, there is no time field at all. + time = state.time.split(':'); + else + time = [0, 0]; window['ui_mpc_seekcur'].max = time[1]; window['ui_mpc_seekcur'].value = time[0];