googleimage plugin: don't run vlc.uri_decode on a nil string
authorRafaël Carré <funman@videolan.org>
Mon, 12 Nov 2007 13:34:54 +0000 (13:34 +0000)
committerRafaël Carré <funman@videolan.org>
Mon, 12 Nov 2007 13:34:54 +0000 (13:34 +0000)
share/luameta/googleimage.lua

index 32d6d59..6bc7456 100644 (file)
@@ -44,5 +44,9 @@ function fetch_art()
     page = vlc.stream_read( fd, 65653 )
     vlc.stream_delete( fd )
     _, _, arturl = string.find( page, "imgurl=([^&]+)" )
-    return vlc.decode_uri(arturl)
+    if arturl then
+        return vlc.decode_uri(arturl)
+    else
+        return nil
+    end
 end