http: Handle unparsable item name in /requests/playlist_jstree.xml
authorMathieu Parent <math.parent@gmail.com>
Thu, 3 Aug 2017 16:27:02 +0000 (18:27 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Fri, 4 Aug 2017 07:51:35 +0000 (09:51 +0200)
Signed-off-by: Mathieu Parent <math.parent@gmail.com>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
share/lua/http/requests/playlist_jstree.xml

index bda87d6..4281117 100644 (file)
@@ -42,6 +42,7 @@ function print_playlist(item)
     if item.flags.disabled then return end
     if(item.children) then
         local name = vlc.strings.convert_xml_special_chars(item.name or "")
+        name = name or ""
         if(name ~= "Undefined") then
                        print('<item id="plid_' ..tostring(item.id).. '" name="' ..tostring(name).. '" ro="' ..(item.flags.ro and "ro" or "rw").. '"><content><name>' ..name.. '</name></content>')
                        for _, child in ipairs(item.children) do
@@ -55,6 +56,7 @@ function print_playlist(item)
                end
     else
         local name, path = vlc.strings.convert_xml_special_chars(item.name or "", item.path or "")
+        name = name or ""
         local current_item_id = vlc.playlist.current()
         local current = ""
         -- Is the item the one currently played