Skip to content
Prev Previous commit
Next Next commit
Merge branch 'master' into lib-828-reinitializers-versions-greater-th…
…an-256
  • Loading branch information
ernestognw committed Jul 27, 2023
commit bae97868fd3b9eb32da7c77b0e8b681036e35a9f
12 changes: 9 additions & 3 deletions contracts/proxy/utils/Initializable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,15 @@ abstract contract Initializable {
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
if (!_isInitializing()) {
revert NotInitializing();
}
_checkInitializing();
_;
}

/**
* @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.
*/
function _checkInitializing() internal view virtual {
if (!_initializing) revert NotInitializing();
}

/**
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.