From ec7e5021ae1e6e4fc01e192637b699589b18d167 Mon Sep 17 00:00:00 2001 From: Gustas <37534529+PunkPun@users.noreply.github.com> Date: Tue, 30 Dec 2025 22:21:41 +0200 Subject: [PATCH] Selection can be null --- .../Widgets/Logic/GameSaveBrowserLogic.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/OpenRA.Mods.Common/Widgets/Logic/GameSaveBrowserLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/GameSaveBrowserLogic.cs index eb35fb41e9..73b4601be4 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/GameSaveBrowserLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/GameSaveBrowserLogic.cs @@ -323,14 +323,19 @@ namespace OpenRA.Mods.Common.Widgets.Logic void Select(string savePath) { selectedPath = savePath; - selectedSave = new GameSave(savePath); - var map = modData.MapCache[selectedSave.GlobalSettings.Map]; - if (map.Status != MapStatus.Available && selectedSave.MapGenerationArgs != null) + if (savePath != null) { - // Add to the MapCache so the server will accept the map - modData.MapCache.GenerateMap(modData, selectedSave.MapGenerationArgs); + selectedSave = new GameSave(savePath); + var map = modData.MapCache[selectedSave.GlobalSettings.Map]; + if (map.Status != MapStatus.Available && selectedSave.MapGenerationArgs != null) + { + // Add to the MapCache so the server will accept the map + modData.MapCache.GenerateMap(modData, selectedSave.MapGenerationArgs); + } } + else + selectedSave = null; if (isSavePanel) {