handle file with no extension in filechooser

This commit is contained in:
Qingping Hou
2012-09-17 20:36:39 -04:00
parent 83d910b7d3
commit eb79e1c95c

View File

@@ -11,7 +11,7 @@ end
function DocumentRegistry:getProvider(file)
-- TODO: some implementation based on mime types?
local extension = string.lower(string.match(file, ".+%.([^.]+)"))
local extension = string.lower(string.match(file, ".+%.([^.]+)") or "")
for _, provider in ipairs(self.providers) do
if extension == provider.extension then
return provider.provider