From eb22f98fa89cdc19a25a484266489f71765da79a Mon Sep 17 00:00:00 2001 From: JakeTrans Date: Tue, 9 Aug 2022 20:41:51 +0100 Subject: [PATCH] workaround for issue 69 sets to unknown --- LegendsViewer/Legends/Events/EntityOverthrown.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/LegendsViewer/Legends/Events/EntityOverthrown.cs b/LegendsViewer/Legends/Events/EntityOverthrown.cs index fbbb4d7..6669cd0 100644 --- a/LegendsViewer/Legends/Events/EntityOverthrown.cs +++ b/LegendsViewer/Legends/Events/EntityOverthrown.cs @@ -54,7 +54,15 @@ public override string Print(bool link = true, DwarfObject pov = null) string eventString = GetYearTime(); eventString += Instigator.ToLink(link, pov, this); eventString += " toppled the government of "; - eventString += OverthrownHistoricalFigure.ToLink(link, pov, this); + try + { + eventString += OverthrownHistoricalFigure.ToLink(link, pov, this); + } + catch + { + OverthrownHistoricalFigure = new HistoricalFigure(); + eventString += OverthrownHistoricalFigure.ToLink(link, pov, this); + } eventString += " of "; eventString += Entity.ToLink(link, pov, this); if (PositionTaker != Instigator) @@ -95,4 +103,4 @@ public override string Print(bool link = true, DwarfObject pov = null) return eventString; } } -} +} \ No newline at end of file