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