Fix a crash when there is no briefing text
This commit is contained in:
@@ -29,7 +29,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
var missionData = world.Map.Rules.Actors[SystemActors.World].TraitInfoOrDefault<MissionDataInfo>();
|
||||
if (missionData != null)
|
||||
{
|
||||
var text = WidgetUtils.WrapText(missionData.Briefing.Replace("\\n", "\n"), mapDescription.Bounds.Width, mapFont);
|
||||
var text = WidgetUtils.WrapText(missionData.Briefing?.Replace("\\n", "\n"), mapDescription.Bounds.Width, mapFont);
|
||||
mapDescription.Text = text;
|
||||
mapDescription.Bounds.Height = mapFont.Measure(text).Y;
|
||||
mapDescriptionPanel.ScrollToTop();
|
||||
|
||||
@@ -234,7 +234,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
infoVideo = missionData.BackgroundVideo;
|
||||
infoVideoVisible = infoVideo != null;
|
||||
|
||||
var briefing = WidgetUtils.WrapText(missionData.Briefing.Replace("\\n", "\n"), description.Bounds.Width, descriptionFont);
|
||||
var briefing = WidgetUtils.WrapText(missionData.Briefing?.Replace("\\n", "\n"), description.Bounds.Width, descriptionFont);
|
||||
var height = descriptionFont.Measure(briefing).Y;
|
||||
Game.RunAfterTick(() =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user