diff --git a/lua/nvim-tree/actions/fs/create-file.lua b/lua/nvim-tree/actions/fs/create-file.lua index 410e88ee..4e5b59c2 100644 --- a/lua/nvim-tree/actions/fs/create-file.lua +++ b/lua/nvim-tree/actions/fs/create-file.lua @@ -12,7 +12,7 @@ local M = {} local function create_and_notify(file) events._dispatch_will_create_file(file) local ok, fd = pcall(vim.loop.fs_open, file, "w", 420) - if not ok then + if not ok or type(fd) ~= "number" then notify.error("Couldn't create file " .. notify.render_path(file)) return end