Skip to content

Commit 123aab9

Browse files
committed
modify: improve map config find method with exact map name
1 parent d0e61b4 commit 123aab9

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

MapChooserSharp/Modules/Nomination/McsMapNominationCommands.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -332,13 +332,7 @@ private void PrintNominatedMap(CCSPlayerController player, int index, IMcsNomina
332332

333333
private IMapConfig? FindConfigByExactName(string mapName)
334334
{
335-
try
336-
{
337-
return _mapConfigProvider.GetMapConfigs()[mapName];
338-
}
339-
catch (Exception)
340-
{
341-
return null;
342-
}
335+
_mapConfigProvider.GetMapConfigs().TryGetValue(mapName, out var mapConfig);
336+
return mapConfig;
343337
}
344338
}

0 commit comments

Comments
 (0)