Add nil check for link_to

This commit is contained in:
Simon Zeng 2020-12-13 23:36:54 -05:00 committed by Kiyan
parent 0862bcc08e
commit 9aa8be639d

View File

@ -49,7 +49,7 @@ local function link_new(cwd, name)
local absolute_path = cwd..'/'..name local absolute_path = cwd..'/'..name
local link_to = luv.fs_realpath(absolute_path) local link_to = luv.fs_realpath(absolute_path)
local open, entries local open, entries
if luv.fs_stat(link_to).type == 'directory' then if (link_to ~= nil) and luv.fs_stat(link_to).type == 'directory' then
open = false open = false
entries = {} entries = {}
end end