feat: safe delegate invocation helper added
This commit is contained in:
@@ -23,7 +23,7 @@ public class StateEnable : IStateEnable
|
||||
|
||||
bool previousState = _enabled;
|
||||
_enabled = value;
|
||||
OnEnabledChanged?.Invoke(this, previousState);
|
||||
OnEnabledChanged?.InvokeSafe(this, previousState);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ public class StateEnable : IStateEnable
|
||||
|
||||
_entity = entity;
|
||||
OnAssign(entity);
|
||||
OnEntityAssigned?.Invoke(this);
|
||||
OnEntityAssigned?.InvokeSafe(this);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ public class StateEnable : IStateEnable
|
||||
return false;
|
||||
|
||||
_entity = null!;
|
||||
OnUnassigned?.Invoke(this);
|
||||
OnUnassigned?.InvokeSafe(this);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user