Use null propagation
This commit is contained in:
@@ -53,9 +53,9 @@ namespace OpenRA.Mods.Common
|
||||
|
||||
public void Initialize(int value)
|
||||
{
|
||||
var field = GetType().GetField(nameof(value), BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
if (field != null)
|
||||
field.SetValue(this, value);
|
||||
GetType()
|
||||
.GetField(nameof(value), BindingFlags.NonPublic | BindingFlags.Instance)
|
||||
?.SetValue(this, value);
|
||||
}
|
||||
|
||||
public override MiniYaml Save()
|
||||
|
||||
Reference in New Issue
Block a user