diff --git a/Fushigi/course/CourseArea.cs b/Fushigi/course/CourseArea.cs index abf310ef..d5ce402e 100644 --- a/Fushigi/course/CourseArea.cs +++ b/Fushigi/course/CourseArea.cs @@ -134,13 +134,21 @@ public void Save(RSTB resource_table, string folder) var decomp_size = (uint)mem.Length; - //Compress and save the course area - string levelPath = Path.Combine(folder, $"{mAreaName}.bcett.byml.zs"); - File.WriteAllBytes(levelPath, FileUtil.CompressData(mem.ToArray())); + try + { + //Compress and save the course area + string levelPath = Path.Combine(folder, $"{mAreaName}.bcett.byml.zs"); + File.WriteAllBytes(levelPath, FileUtil.CompressData(mem.ToArray())); - //Update resource table - // filePath is a key not an actual path so we cannot use Path.Combine - resource_table.SetResource($"BancMapUnit/{mAreaName}.bcett.byml", decomp_size); + //Update resource table + // filePath is a key not an actual path so we cannot use Path.Combine + resource_table.SetResource($"BancMapUnit/{mAreaName}.bcett.byml", decomp_size); + } + catch(IOException e) + { + //Likely due to the course being open in the game, caught to prevent crash + //TODO: notify the user + } } public string GetName()