console.lua: fix crash if no completions exist

If complete is case-sensitive and no completions exist the script crashes
with the following:

Lua error: @console.lua:1417: attempt to concatenate local 'prefix'
(a nil value)
This commit is contained in:
nanahi authored and Dudemanguy committed 2024-05-28 13:24:16 +00:00
1 parent ef026ffdb6
commit 75f252c47c
1 file changed
+1 -1
+1 -1
View File
@@ -1184,7 +1184,7 @@ local function complete_match(part, list)
local prefix = find_common_prefix(completions)
if opts.case_sensitive then
return completions, prefix
return completions, prefix or part
end
completions = {}