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

Filip Roséen git at videolan.org
Mon Dec 5 07:23:30 CET 2016


vlc/vlc-2.2 | branch: master | Filip Roséen <filip at atch.se> | Wed Oct 26 16:18:17 2016 +0200| [34d41f7d0a336022d96115ce95d61291a6bd5bff] | 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>
(cherry picked from commit 1d1e6a42cc64ce190c67a6c62c636f695c43d26d)
Signed-off-by: Pierre Ynard <linkfanel at yahoo.fr>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=34d41f7d0a336022d96115ce95d61291a6bd5bff
---

 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 0a0f436..bdc5b79 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