Skip to content

Commit 318ca00

Browse files
authored
fix: updated control flow around optional callbacks (#124)
1 parent 61cd64e commit 318ca00

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/ModularCore.sol

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -352,13 +352,11 @@ abstract contract ModularCore is IModularCore, OwnableRoles, ReentrancyGuard {
352352

353353
if (callbackFunction.implementation != address(0)) {
354354
(success, returndata) = address(this).staticcall(_abiEncodedCalldata);
355-
} else {
356-
if (callbackMode == CallbackMode.REQUIRED) {
357-
revert CallbackFunctionRequired();
355+
if (!success) {
356+
_revert(returndata, CallbackExecutionReverted.selector);
358357
}
359-
}
360-
if (!success) {
361-
_revert(returndata, CallbackExecutionReverted.selector);
358+
} else if (callbackMode == CallbackMode.REQUIRED) {
359+
revert CallbackFunctionRequired();
362360
}
363361
}
364362

0 commit comments

Comments
 (0)