diff --git a/contracts/BC_fusion/StakeHub.sol b/contracts/BC_fusion/StakeHub.sol index 587b6749..9f8ba670 100644 --- a/contracts/BC_fusion/StakeHub.sol +++ b/contracts/BC_fusion/StakeHub.sol @@ -341,7 +341,10 @@ contract StakeHub is System, Initializable, Protectable { } _validators[operatorAddress].agent = newAgent; - agentToOperator[newAgent] = operatorAddress; + + if (newAgent != address(0)) { + agentToOperator[newAgent] = operatorAddress; + } emit AgentChanged(operatorAddress, oldAgent, newAgent); }