From cb3d88710c8b07f48d95b908fd8ef1913ac8e517 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Sat, 5 Jan 2013 15:28:38 -0500 Subject: Do not error on non-existant dropped URIs; core/gui.lua --- core/gui.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/gui.lua') diff --git a/core/gui.lua b/core/gui.lua index 6f4b27a8..4492fc79 100644 --- a/core/gui.lua +++ b/core/gui.lua @@ -331,8 +331,8 @@ events_connect(events.URI_DROPPED, function(utf8_uris) return string.char(tonumber(hex, 16)) end) if WIN32 then utf8_uri = utf8_uri:sub(2, -1) end -- ignore leading '/' - local uri = utf8_uri:iconv(_CHARSET, 'UTF-8') - if lfs.attributes(uri).mode ~= 'directory' then io.open_file(utf8_uri) end + local mode = lfs.attributes(utf8_uri:iconv(_CHARSET, 'UTF-8'), 'mode') + if mode and mode ~= 'directory' then io.open_file(utf8_uri) end end end end) -- cgit v1.2.3