From b390bb06e7850f1d10640f396cbe4c7f176e1855 Mon Sep 17 00:00:00 2001 From: yetone Date: Mon, 16 Jun 2025 12:13:39 +0800 Subject: [PATCH] fix: check path is nil (#2235) --- lua/avante/llm_tools/view.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/avante/llm_tools/view.lua b/lua/avante/llm_tools/view.lua index 2ff684a..2fec92b 100644 --- a/lua/avante/llm_tools/view.lua +++ b/lua/avante/llm_tools/view.lua @@ -88,6 +88,7 @@ M.returns = { ---@type AvanteLLMToolFunc<{ path: string, start_line?: integer, end_line?: integer }> function M.func(opts, on_log, on_complete, session_ctx) + if not opts.path then return false, "path is required" end if on_log then on_log("path: " .. opts.path) end local abs_path = Helpers.get_abs_path(opts.path) if not Helpers.has_permission_to_access(abs_path) then return false, "No permission to access path: " .. abs_path end