[vlc-commits] lua/intf/cli: fix invalid concatenation of empty string

Filip Roséen git at videolan.org
Wed Oct 26 16:19:43 CEST 2016


vlc | branch: master | Filip Roséen <filip at atch.se> | Wed Oct 26 16:18:17 2016 +0200| [1d1e6a42cc64ce190c67a6c62c636f695c43d26d] | committer: Pierre Ynard

lua/intf/cli: fix invalid concatenation of empty string

If an item lacks a name the value of "item.name" is nil, meaning that
it is an error trying to use it during concatenation.

These changes simply falls back to "item.path" in case the mentioned
metadata is missing.

fixes #17545

Signed-off-by: Pierre Ynard <linkfanel at yahoo.fr>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1d1e6a42cc64ce190c67a6c62c636f695c43d26d
---

 share/lua/intf/cli.lua | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/share/lua/intf/cli.lua b/share/lua/intf/cli.lua
index 015bd87..b6aee56 100644
--- a/share/lua/intf/cli.lua
+++ b/share/lua/intf/cli.lua
@@ -215,7 +215,8 @@ function playlist(name,client,arg)
     function playlist0(item,prefix)
         local prefix = prefix or ""
         if not item.flags.disabled then
-            local str = "| "..prefix..tostring(item.id).." - "..item.name
+            local str = "| "..prefix..tostring(item.id).." - "..
+                            ( item.name or item.path )
             if item.duration > 0 then
                 str = str.." ("..common.durationtostring(item.duration)..")"
             end



More information about the vlc-commits mailing list