Skip to content

Commit f3df514

Browse files
authored
fix(utils): handle libuv fail when getting username info (#1924)
1 parent a9c9251 commit f3df514

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lua/neo-tree/utils/_compat.lua

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,9 @@ local function path_resolve_dot(path)
141141
return (is_path_absolute and "/" or "") .. table.concat(new_path_components, "/")
142142
end
143143

144-
local ok, passwd = pcall(uv.os_get_passwd)
144+
local passwd = uv.os_get_passwd()
145145
---@type string?
146-
local user
147-
if ok then
148-
user = passwd.username
149-
end
146+
local user = passwd and passwd.username or nil
150147

151148
local path_segment_ends = { "/", "\\", "" }
152149
---@param path string

0 commit comments

Comments
 (0)