From 5b8e3ed3fe0f503a73fd79dbc8dc10e9538135e0 Mon Sep 17 00:00:00 2001 From: gomes <17035424+gomesalexandre@users.noreply.github.com> Date: Tue, 7 May 2024 01:10:17 +0300 Subject: [PATCH] fix: better narrowing --- src/pages/ThorChainLP/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/ThorChainLP/utils.ts b/src/pages/ThorChainLP/utils.ts index 0b88c2e1a6c..3cfe5c0c007 100644 --- a/src/pages/ThorChainLP/utils.ts +++ b/src/pages/ThorChainLP/utils.ts @@ -11,7 +11,7 @@ export type Opportunity = { export const fromOpportunityId = (opportunityId: string): Opportunity => { const [assetId, type] = opportunityId.split('*') - if (!assetId) throw new Error(`Invalid opportunityId: ${opportunityId}`) + if (!assetId || !type) throw new Error(`Invalid opportunityId: ${opportunityId}`) fromAssetId(assetId)