Remove superfluous null checks.

This commit is contained in:
Matthias Mailänder
2020-09-19 10:05:29 +02:00
committed by Paul Chote
parent 4627387ae3
commit 2e438f1da9

View File

@@ -71,10 +71,10 @@ namespace OpenRA.Mods.Common.Widgets
cancelButton.OnClick = () =>
{
Ui.CloseWindow();
onCancel?.Invoke();
onCancel();
};
if (!string.IsNullOrEmpty(cancelText) && cancelButton != null)
if (!string.IsNullOrEmpty(cancelText))
cancelButton.GetText = () => cancelText;
}
@@ -84,10 +84,10 @@ namespace OpenRA.Mods.Common.Widgets
otherButton.Bounds.Y += headerHeight;
otherButton.OnClick = () =>
{
onOther?.Invoke();
onOther();
};
if (!string.IsNullOrEmpty(otherText) && otherButton != null)
if (!string.IsNullOrEmpty(otherText))
otherButton.GetText = () => otherText;
}
}