diff --git a/src/MetaMorpho.sol b/src/MetaMorpho.sol index 1636c077..25ef16f5 100644 --- a/src/MetaMorpho.sol +++ b/src/MetaMorpho.sol @@ -345,6 +345,7 @@ contract MetaMorpho is ERC4626, ERC20Permit, Ownable2Step, Multicall, IMetaMorph Id id = withdrawQueue[i]; if (config[id].cap != 0) revert ErrorsLib.InvalidMarketRemovalNonZeroCap(id); + if (pendingCap[id].validAt != 0) revert ErrorsLib.PendingCap(id); if (MORPHO.supplyShares(id, address(this)) != 0) { if (config[id].removableAt == 0) revert ErrorsLib.InvalidMarketRemovalNonZeroSupply(id); @@ -354,8 +355,6 @@ contract MetaMorpho is ERC4626, ERC20Permit, Ownable2Step, Multicall, IMetaMorph } } - if (pendingCap[id].validAt != 0) revert ErrorsLib.PendingCap(id); - delete config[id]; } }