From 47d4baafcc370f16c195fd718f37f8fb1e0aa9a1 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 19 Jan 2024 16:09:28 +0100 Subject: [PATCH] fix(fs): error when plugin directory to delete is not a valid directory --- lua/lazy/manage/task/fs.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazy/manage/task/fs.lua b/lua/lazy/manage/task/fs.lua index 525997e..c753143 100644 --- a/lua/lazy/manage/task/fs.lua +++ b/lua/lazy/manage/task/fs.lua @@ -13,7 +13,7 @@ M.clean = { assert(dir:find(Config.options.root, 1, true) == 1, self.plugin.dir .. " should be under packpath!") local stat = vim.loop.fs_lstat(dir) - assert(stat.type == "directory", self.plugin.dir .. " should be a directory!") + assert(stat and stat.type == "directory", self.plugin.dir .. " should be a directory!") Util.walk(dir, function(path, _, type) if type == "directory" then