fix: never attempt to concatenate nil values, use empty strings (#2692) (#2812)

* fix: never attempt to concatenate nil values, use empty strings (#2692)

* [pre-commit.ci lite] apply automatic fixes

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
This commit is contained in:
Marius Niveri
2025-10-31 10:53:06 +01:00
committed by GitHub
parent 159b452426
commit 15ef2a012c

View File

@@ -59,6 +59,10 @@ function M.func(input, opts)
local replace_in_file = require("avante.llm_tools.replace_in_file")
local Utils = require("avante.utils")
if input.new_str == nil then input.new_str = "" end
if input.old_str == nil then input.old_str = "" end
-- Remove trailing spaces from the new string
input.new_str = Utils.remove_trailing_spaces(input.new_str)