-
|
Beta Was this translation helpful? Give feedback.
Answered by
tomlau10
Aug 21, 2025
Replies: 2 comments 2 replies
-
|
you aren't checking if not rectangle_region then error("my_screenshot error taking screenshot") end |
Beta Was this translation helpful? Give feedback.
0 replies
-
But didn't I explicitly do that in -- vvvvvvvvvvvvvvvvvvvv
if not rectangle_region or rectangle_region == "" then
-- ...
end |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

The warning is saying that you didn't check
nilforrectangle_regionwhen you callrectangle_region:gsub(...)😅local rectangle_region, e = proc(slurp_command)=>
rectangle_regionmaybenilhere I believeproc()to return a pair, i.e.(string, nil)or(nil, error)(related discussion: #3102)
rectangle_region: string|nilande: error|nilgsub()line, you are doing<string|nil>:gsub(...)in the viewpoint of LuaLS=> missing nil check
In the meantime, if you don't want to change the code struc…