avoid passing nil to string.sub
This commit is contained in:
parent
d58ed66d0a
commit
cb150775ec
|
@ -50,10 +50,13 @@ function playerctl:watch(timeout, callback, widget)
|
|||
position = position,
|
||||
length = length,
|
||||
album = words[7],
|
||||
year = string.sub(words[8], 0, 4),
|
||||
progress = progress,
|
||||
}
|
||||
|
||||
if words[8] ~= nil then
|
||||
metadata.year = string.sub(words[8], 0, 4)
|
||||
end
|
||||
|
||||
callback(widget, metadata)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue