Skip to content

Commit cfac083

Browse files
committed
fix(fork-readiness): add safe navigation for min_client_versions
Fixes TypeError when fork.min_client_versions is undefined by using a fallback to empty object. This prevents errors when the fork configuration is not fully initialized.
1 parent e5b0d70 commit cfac083

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/pages/xatu/fork-readiness/hooks/useForkReadiness/useForkReadiness.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ function getAllForks(network: Network): Array<{
3030
if (fork) {
3131
// Convert MinClientVersions to Record<string, string>
3232
const minVersions: Record<string, string> = {};
33-
for (const [client, version] of Object.entries(fork.min_client_versions)) {
33+
const minClientVersions = fork.min_client_versions || {};
34+
for (const [client, version] of Object.entries(minClientVersions)) {
3435
if (typeof version === 'string') {
3536
minVersions[client] = version;
3637
}

0 commit comments

Comments
 (0)