Skip to content

Commit

Permalink
Made onlyModuleOrOwner definition consisitent (#674)
Browse files Browse the repository at this point in the history
* Made onlyModuleOrOwner definition consisitent

* Added braces

* Added braces
  • Loading branch information
maxsam4 authored May 31, 2019
1 parent f307619 commit 77e68d0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
11 changes: 7 additions & 4 deletions contracts/ModuleRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}

Expand Down
3 changes: 2 additions & 1 deletion contracts/SecurityTokenRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,9 @@ contract SecurityTokenRegistry is EternalStorage, Proxy {
}

function _whenNotPausedOrOwner() internal view {
if (msg.sender != owner())
if (msg.sender != owner()) {
require(!isPaused(), "Paused");
}
}

/**
Expand Down

0 comments on commit 77e68d0

Please sign in to comment.