Skip to content

Commit 4fc2c42

Browse files
committed
fix: correct fallback_call filter logic
Incorrect logic causes the function `fallback_call` to always return `fallback_value` when `with_filter` is nil
1 parent 821b570 commit 4fc2c42

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lua/codeium/util.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ local M = {}
66
function M.fallback_call(calls, with_filter, fallback_value)
77
for _, i in ipairs(calls) do
88
local ok, result = pcall(unpack(i))
9-
if ok and (with_filter ~= nil and with_filter(result)) then
9+
if ok and (with_filter == nil or with_filter(result)) then
1010
return result
1111
end
1212
end

0 commit comments

Comments
 (0)