Don't try to remove tooltips that haven't been added.

This commit is contained in:
Paul Chote
2018-01-01 16:04:05 +00:00
committed by Pavel Penev
parent 2eb090f153
commit 7b056509ec

View File

@@ -55,10 +55,10 @@ namespace OpenRA.Mods.Common.Widgets
public override void MouseExited()
{
if (TooltipContainer == null)
return;
tooltipContainer.Value.RemoveTooltip();
// Only try to remove the tooltip if we know it has been created
// This avoids a crash if the widget (and the container it refers to) are being removed
if (TooltipContainer != null && tooltipContainer.IsValueCreated)
tooltipContainer.Value.RemoveTooltip();
}
}
}