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,
|
position = position,
|
||||||
length = length,
|
length = length,
|
||||||
album = words[7],
|
album = words[7],
|
||||||
year = string.sub(words[8], 0, 4),
|
|
||||||
progress = progress,
|
progress = progress,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if words[8] ~= nil then
|
||||||
|
metadata.year = string.sub(words[8], 0, 4)
|
||||||
|
end
|
||||||
|
|
||||||
callback(widget, metadata)
|
callback(widget, metadata)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue