From 0121d00478bcbf38cc88c71b40d70804b1fb1588 Mon Sep 17 00:00:00 2001 From: bitingsock Date: Sat, 17 Oct 2015 21:26:35 -0700 Subject: TOOLS/autoload: avoid throwing an error when playing e.g. youtube Signed-off-by: wm4 --- TOOLS/lua/autoload.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'TOOLS') diff --git a/TOOLS/lua/autoload.lua b/TOOLS/lua/autoload.lua index 2737418dcd..0c8c9a5381 100644 --- a/TOOLS/lua/autoload.lua +++ b/TOOLS/lua/autoload.lua @@ -30,7 +30,12 @@ function add_files_at(index, files) end function get_extension(path) - return string.match(path, "%.([^%.]+)$" ) + match = string.match(path, "%.([^%.]+)$" ) + if match == nil then + return "nomatch" + else + return match + end end table.filter = function(t, iter) -- cgit v1.2.3