# HG changeset patch # User IBBoard # Date 1254167810 0 # Node ID f1b7a08a8f6f4183b541ee1655eefb114694614c # Parent 12f11e3c62614e45889687da3298fdb97889926b Re #177: "Crash" when equipmenttag * Show custom dialog instead of crashing Exception messages could still be improved and translatable diff -r 12f11e3c6261 -r f1b7a08a8f6f FrmMain.cs --- a/FrmMain.cs Mon Sep 28 19:50:16 2009 +0000 +++ b/FrmMain.cs Mon Sep 28 19:56:50 2009 +0000 @@ -571,7 +571,18 @@ if (dr == DialogResult.OK) { - CurrentArmy = new Army(newArmy.SelectedRace, newArmy.ArmyName, newArmy.ArmySize); + try + { + CurrentArmy = new Army(newArmy.SelectedRace, newArmy.ArmyName, newArmy.ArmySize); + } + catch (RequiredDataMissingException ex) + { + MessageBox.Show(this, ex.Message, Translation.GetTranslation("InvalidRaceFileBoxTitle", "Invalid race file"), MessageBoxButtons.OK, MessageBoxIcon.Error); + } + catch (InvalidFileException ex) + { + MessageBox.Show(this, ex.Message, Translation.GetTranslation("InvalidRaceFileBoxTitle", "Invalid race file"), MessageBoxButtons.OK, MessageBoxIcon.Error); + } } } }