From 7ed76e485fab14195e717c2ee96ef2036dc1c6f7 Mon Sep 17 00:00:00 2001 From: AlaaElattar Date: Tue, 26 Mar 2024 16:39:31 +0200 Subject: [PATCH] added condition to check first if rentContractId not equal zero --- packages/playground/src/utils/nodeSelector.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/playground/src/utils/nodeSelector.ts b/packages/playground/src/utils/nodeSelector.ts index d81df3b2b6..fa82444ff7 100644 --- a/packages/playground/src/utils/nodeSelector.ts +++ b/packages/playground/src/utils/nodeSelector.ts @@ -208,9 +208,11 @@ export async function validateRentContract( } try { - const contractInfo = await gridStore.grid.contracts.get({ id: node.rentContractId }); - if (contractInfo.state.gracePeriod) { - throw `You can't deploy on node ${node.nodeId}, its rent contract in grace period. `; + if (node.rentContractId !== 0) { + const contractInfo = await gridStore.grid.contracts.get({ id: node.rentContractId }); + if (contractInfo.state.gracePeriod) { + throw `You can't deploy on node ${node.nodeId}, its rent contract is in grace period.`; + } } return true; @@ -219,7 +221,6 @@ export async function validateRentContract( error, "Something went wrong while checking status of the node. Please check your connection and try again.", ); - throw err; } }