diff --git a/contracts/ModuleRegistry.sol b/contracts/ModuleRegistry.sol index 59a02af74..461200937 100644 --- a/contracts/ModuleRegistry.sol +++ b/contracts/ModuleRegistry.sol @@ -80,10 +80,13 @@ contract ModuleRegistry is IModuleRegistry, EternalStorage { * @notice Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPausedOrOwner() { - if (msg.sender == owner()) _; - else { - require(!isPaused(), "Already paused"); - _; + _whenNotPausedOrOwner(); + _; + } + + function _whenNotPausedOrOwner() internal view { + if (msg.sender != owner()) { + require(!isPaused(), "Paused"); } } diff --git a/contracts/SecurityTokenRegistry.sol b/contracts/SecurityTokenRegistry.sol index f16baab30..121c4a637 100644 --- a/contracts/SecurityTokenRegistry.sol +++ b/contracts/SecurityTokenRegistry.sol @@ -171,8 +171,9 @@ contract SecurityTokenRegistry is EternalStorage, Proxy { } function _whenNotPausedOrOwner() internal view { - if (msg.sender != owner()) + if (msg.sender != owner()) { require(!isPaused(), "Paused"); + } } /**