Use Null-Propagation Operator
This commit is contained in:
@@ -267,8 +267,7 @@ namespace OpenRA.Scripting
|
||||
return;
|
||||
|
||||
disposed = true;
|
||||
if (runtime != null)
|
||||
runtime.Dispose();
|
||||
runtime?.Dispose();
|
||||
}
|
||||
|
||||
static IEnumerable<Type> ExtractRequiredTypes(Type t)
|
||||
|
||||
@@ -168,8 +168,7 @@ namespace OpenRA.Scripting
|
||||
{
|
||||
// Object needs additional notification / context
|
||||
var notify = obj as IScriptNotifyBind;
|
||||
if (notify != null)
|
||||
notify.OnScriptBind(context);
|
||||
notify?.OnScriptBind(context);
|
||||
|
||||
return new LuaCustomClrObject(obj);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user