From bb559dab2bc97b7b646b7a8f565a11ac74a50d05 Mon Sep 17 00:00:00 2001 From: Schlagonia Date: Fri, 11 Oct 2024 15:52:44 -0600 Subject: [PATCH] chore: dont revert --- src/registry/ReleaseRegistry.sol | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/registry/ReleaseRegistry.sol b/src/registry/ReleaseRegistry.sol index e6c9bda..0b2113d 100644 --- a/src/registry/ReleaseRegistry.sol +++ b/src/registry/ReleaseRegistry.sol @@ -47,28 +47,31 @@ contract ReleaseRegistry is Governance2Step { /** * @notice Returns the latest factory. - * @dev Throws if no releases are registered yet. * @return The address of the factory for the latest release. */ function latestFactory() external view virtual returns (address) { + uint256 _numReleases = numReleases; + if (_numReleases == 0) return address(0); return factories[numReleases - 1]; } /** * @notice Returns the latest tokenized strategy. - * @dev Throws if no releases are registered yet. * @return The address of the tokenized strategy for the latest release. */ function latestTokenizedStrategy() external view virtual returns (address) { + uint256 _numReleases = numReleases; + if (_numReleases == 0) return address(0); return tokenizedStrategies[numReleases - 1]; } /** * @notice Returns the api version of the latest release. - * @dev Throws if no releases are registered yet. * @return The api version of the latest release. */ function latestRelease() external view virtual returns (string memory) { + uint256 _numReleases = numReleases; + if (_numReleases == 0) return ""; return IFactory(factories[numReleases - 1]).apiVersion(); // dev: no release }