Skip to content

Commit 80839fc

Browse files
committed
Fix crash in console auto-complete with cursor == 0
1 parent 5ab62e7 commit 80839fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/engine/framework/ConsoleField.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ namespace Console {
9292
Cmd::Args args(std::string(commandStart, commandEnd));
9393
int argNum = args.Argc() - 1;
9494
std::string prefix;
95-
if (!args.Argc() || Str::cisspace(GetText()[GetCursorPos() - 1])) {
95+
if (!args.Argc() || !GetCursorPos() || Str::cisspace(GetText()[GetCursorPos() - 1])) {
9696
argNum++;
9797
} else {
9898
prefix = args.Argv(argNum);

0 commit comments

Comments
 (0)