[vlc-commits] metachannels: don't crash if image tag is missing
Pierre Ynard
git at videolan.org
Sat Feb 11 23:39:46 CET 2012
vlc/vlc-2.0 | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Sat Feb 11 23:35:44 2012 +0100| [637c9b52d29791f27368b84483a305441bbeb6b0] | committer: Pierre Ynard
metachannels: don't crash if image tag is missing
Fixes #6008
(cherry picked from commit e0a19b96e8a920a37ba59f4418bf955df18b0561)
Signed-off-by: Pierre Ynard <linkfanel at yahoo.fr>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=637c9b52d29791f27368b84483a305441bbeb6b0
---
share/lua/sd/metachannels.lua | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/share/lua/sd/metachannels.lua b/share/lua/sd/metachannels.lua
index 3913377..21152e6 100644
--- a/share/lua/sd/metachannels.lua
+++ b/share/lua/sd/metachannels.lua
@@ -59,9 +59,14 @@ function main()
if( item.name == 'item' ) then
simplexml.add_name_maps( item )
local url = string.gsub( item.children_map['link'][1].children[1], '&', '&' )
+ local title = item.children_map['title'][1].children[1]
+ local arturl = nil
+ if item.children_map['image'] ~= nil then
+ arturl = item.children_map['image'][1].children_map['url'][1].children[1]
+ end
local node = vlc.sd.add_item( { path = url,
- title = item.children_map['title'][1].children[1],
- arturl = item.children_map['image'][1].children_map['url'][1].children[1] } )
+ title = title,
+ arturl = arturl } )
end
end
end
More information about the vlc-commits
mailing list