Skip to content

Commit

Permalink
fix: better narrowing
Browse files Browse the repository at this point in the history
  • Loading branch information
gomesalexandre committed May 6, 2024
1 parent dfe5711 commit 5b8e3ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pages/ThorChainLP/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 5b8e3ed

Please sign in to comment.