Fix server NRE on clicking alerts with no OnClick (#2748)
* #2744 fix NRE on clicking alerts with no OnClick, and don't send the click message unless the alert has an onclick * #2744 fix NRE on clicking alerts with no OnClick, and don't send the click message unless the alert has an onclick
This commit is contained in:
@@ -71,7 +71,7 @@ namespace Content.Server.GameObjects.Components.Mobs
|
||||
break;
|
||||
}
|
||||
|
||||
if (AlertManager.TryGet(msg.AlertType, out var alert))
|
||||
if (AlertManager.TryGet(msg.AlertType, out var alert) && alert.OnClick != null)
|
||||
{
|
||||
alert.OnClick.AlertClicked(new ClickAlertEventArgs(player, alert));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user