Issue #18936: The game no longer crashes when TextFieldWidget sends Enter key press and onSelect action is null.

This commit is contained in:
nvrnight
2020-12-31 02:32:49 -06:00
committed by Matthias Mailänder
parent b44a9ab5fc
commit b3f39bffce

View File

@@ -43,7 +43,12 @@ namespace OpenRA.Mods.Common.Widgets.Logic
this.modData = modData;
this.onSelect = onSelect;
var approving = new Action(() => { Ui.CloseWindow(); onSelect(selectedUid); });
var approving = new Action(() =>
{
Ui.CloseWindow();
onSelect?.Invoke(selectedUid);
});
var canceling = new Action(() => { Ui.CloseWindow(); onExit(); });
var okButton = widget.Get<ButtonWidget>("BUTTON_OK");