Skip to content

Commit 18c3c8b

Browse files
committed
Fix crash with whisper command
1 parent 8fc61ff commit 18c3c8b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Essentials/PlayerCommands.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@ public void Whisper(string playerName)
1818
if (Context.Args.Count < 1)
1919
return;
2020

21-
//var playerName = Context.Args[0];
22-
Console.WriteLine($"'{playerName}'");
2321
var msgIndex = Context.RawArgs.IndexOf(" ", playerName.Length);
24-
if (msgIndex > Context.RawArgs.Length)
22+
if (msgIndex == -1 || msgIndex > Context.RawArgs.Length - 1)
2523
return;
2624

2725
var message = Context.RawArgs.Substring(msgIndex);

0 commit comments

Comments
 (0)