From 7fb021bb9573c453a5704fb09cbe0b602920d9c6 Mon Sep 17 00:00:00 2001 From: spypsy Date: Wed, 30 Aug 2023 15:30:38 +0100 Subject: [PATCH] ensure command doesn't fail due to missing client version --- yarn-project/aztec-cli/src/client.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/yarn-project/aztec-cli/src/client.ts b/yarn-project/aztec-cli/src/client.ts index 2878119a3d8..8750873a10d 100644 --- a/yarn-project/aztec-cli/src/client.ts +++ b/yarn-project/aztec-cli/src/client.ts @@ -56,6 +56,9 @@ class VersionMismatchError extends Error {} export async function checkServerVersion(rpc: AztecRPC, expectedVersionRange: string, logger?: DebugLogger) { const serverName = 'Aztec Sandbox'; const { client } = await rpc.getNodeInfo(); + if (!client) { + throw new VersionMismatchError(`Couldn't determine ${serverName} version. You may run into issues.`); + } const version = client.split('@')[1]; logger?.debug(`Comparing server version ${version} against CLI expected ${expectedVersionRange}`); if (!version || !valid(version)) {