diff --git a/src/account/ModularAccountView.sol b/src/account/ModularAccountView.sol index 19518e78..391305f3 100644 --- a/src/account/ModularAccountView.sol +++ b/src/account/ModularAccountView.sol @@ -17,6 +17,7 @@ abstract contract ModularAccountView is IERC6900AccountView { /// @inheritdoc IERC6900AccountView function getExecutionData(bytes4 selector) external view override returns (ExecutionDataView memory data) { + ExecutionStorage storage executionStorage = getAccountStorage().executionStorage[selector]; if ( selector == IERC6900Account.execute.selector || selector == IERC6900Account.executeBatch.selector || selector == UUPSUpgradeable.upgradeToAndCall.selector @@ -26,16 +27,14 @@ abstract contract ModularAccountView is IERC6900AccountView { data.module = address(this); data.allowGlobalValidation = true; } else { - ExecutionStorage storage executionStorage = getAccountStorage().executionStorage[selector]; data.module = executionStorage.module; data.skipRuntimeValidation = executionStorage.skipRuntimeValidation; data.allowGlobalValidation = executionStorage.allowGlobalValidation; - - uint256 executionHooksLen = executionStorage.executionHooks.length(); - data.executionHooks = new HookConfig[](executionHooksLen); - for (uint256 i = 0; i < executionHooksLen; ++i) { - data.executionHooks[i] = toHookConfig(executionStorage.executionHooks.at(i)); - } + } + uint256 executionHooksLen = executionStorage.executionHooks.length(); + data.executionHooks = new HookConfig[](executionHooksLen); + for (uint256 i = 0; i < executionHooksLen; ++i) { + data.executionHooks[i] = toHookConfig(executionStorage.executionHooks.at(i)); } }