From d0be970387fd04feb172f2acdc01ee0d81522398 Mon Sep 17 00:00:00 2001 From: Jakub Nowakowski Date: Fri, 8 Dec 2023 13:23:43 +0100 Subject: [PATCH] Check for zero address --- core/contracts/Dispatcher.sol | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/contracts/Dispatcher.sol b/core/contracts/Dispatcher.sol index cb24deb2d..d175a5fe9 100644 --- a/core/contracts/Dispatcher.sol +++ b/core/contracts/Dispatcher.sol @@ -27,6 +27,8 @@ contract Dispatcher is Router, Ownable { function migrateShares(IERC4626[] calldata _vaults) public onlyOwner { address newDispatcher = address(acre.dispatcher()); + require(newDispatcher != address(0), "new dispatcher address cannot be zero address"); + for (uint i=0; i<_vaults.length; i++) { _vaults[i].transfer(newDispatcher, _vaults[i].balanceOf(address(this))); }