From d6dd7ecbd2926271da43d6276c26af1910b321cf Mon Sep 17 00:00:00 2001 From: timiimit Date: Wed, 15 Mar 2023 10:05:22 +0100 Subject: [PATCH] Fix null exception --- UT4MasterServer/Controllers/UT/MatchmakingController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UT4MasterServer/Controllers/UT/MatchmakingController.cs b/UT4MasterServer/Controllers/UT/MatchmakingController.cs index f2f21ef1..b93097dc 100644 --- a/UT4MasterServer/Controllers/UT/MatchmakingController.cs +++ b/UT4MasterServer/Controllers/UT/MatchmakingController.cs @@ -95,7 +95,7 @@ public async Task CreateGameServer([FromBody] GameServer server) throw new Exception("This should never happen"); } - var serverName = server.Attributes.Get(GameServerAttributes.UT_SERVERNAME_s) as string; + var serverName = server.Attributes.Get(GameServerAttributes.UT_SERVERNAME_s) as string ?? string.Empty; var isRanked = (int?)server.Attributes.Get(GameServerAttributes.UT_RANKED_i) == 1; if (trust != GameServerTrust.Epic && !isRanked && serverName.Trim() != client.Name.Trim()) {