Skip to content

Commit b80358e

Browse files
committed
fix(adapters): only try and replace str variables
1 parent 82cacda commit b80358e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lua/codecompanion/adapters/init.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ local log = require("codecompanion.utils.log")
1212
---@field headers table The headers to pass to the request
1313
---@field parameters table The parameters to pass to the request
1414
---@field body table Additional body parameters to pass to the request
15+
---@field temp? table A table to store temporary values which are not passed to the request
1516
---@field raw? table Any additional curl arguments to pass to the request
1617
---@field opts? table Additional options for the adapter
1718
---@field handlers table Functions which link the output from the request to CodeCompanion
@@ -105,6 +106,10 @@ end
105106
---@param str string
106107
---@return string
107108
local function replace_var(adapter, str)
109+
if type(str) ~= "string" then
110+
return str
111+
end
112+
108113
local pattern = "${(.-)}"
109114

110115
local result = str:gsub(pattern, function(var)

0 commit comments

Comments
 (0)