Skip to content

Commit cb70642

Browse files
DrMeepsoCopilot
andauthored
Update Cove/Server/Server.Punish.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 5c6d775 commit cb70642

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Cove/Server/Server.Punish.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ private void writeToBansFile(CSteamID id)
6565
{
6666
string fileDir = $"{AppDomain.CurrentDomain.BaseDirectory}bans.txt";
6767
PreviousPlayer player = PreviousPlayers.Find(p => p.SteamId == id);
68-
File.AppendAllLines(fileDir, [$"{id.m_SteamID} #{player.Username}"]);
68+
string username = player != null ? player.Username : "Unknown";
69+
File.AppendAllLines(fileDir, [$"{id.m_SteamID} #{username}"]);
6970
}
7071

7172
public void kickPlayer(CSteamID id)

0 commit comments

Comments
 (0)