[vlc-devel] commit: Prevent errors if item name is nil ( I wonder why that happens though). (Antoine Cellerier )
git version control
git at videolan.org
Sun Dec 27 20:20:18 CET 2009
vlc | branch: master | Antoine Cellerier <dionoea at videolan.org> | Tue Dec 22 00:08:26 2009 +0100| [054c7f95c116126e6d4f80ad5e4e140dd8d1a99f] | committer: Antoine Cellerier
Prevent errors if item name is nil (I wonder why that happens though).
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=054c7f95c116126e6d4f80ad5e4e140dd8d1a99f
---
share/lua/http/requests/playlist.xml | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/share/lua/http/requests/playlist.xml b/share/lua/http/requests/playlist.xml
index 1576216..2810196 100644
--- a/share/lua/http/requests/playlist.xml
+++ b/share/lua/http/requests/playlist.xml
@@ -30,14 +30,14 @@ vim:syntax=lua
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)
+ local name = vlc.strings.convert_xml_special_chars(item.name or "")
print("<node id=\""..tostring(item.id).."\" name=\""..name.."\" ro=\""..(item.flags.ro and "ro" or "rw").."\">")
for _, c in ipairs(item.children) do
print_playlist(c)
end
print("</node>")
else
- local name, path = vlc.strings.convert_xml_special_chars(item.name,item.path or "")
+ local name, path = vlc.strings.convert_xml_special_chars(item.name or "",item.path or "")
print("<leaf id='"..tostring(item.id).."' uri='"..path.."' name='"..name.."' ro='"..(item.flags.ro and "ro" or "rw").."' duration='"..tostring(item.duration).."'/>")
end
end
More information about the vlc-devel
mailing list