Skip to content

Commit

Permalink
Check for nil line
Browse files Browse the repository at this point in the history
  • Loading branch information
luozhiya committed May 15, 2024
1 parent aa3796c commit f5855e0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lua/fittencode/engines/actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,12 @@ local function on_error(err)
end
end

---@param line string
---@param line? string
---@return number?
local function find_nospace(line)
if not line then
return
end
for i = 1, #line do
if line:sub(i, i) ~= ' ' then
return i
Expand Down

0 comments on commit f5855e0

Please sign in to comment.