Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

chore: add error message for when new Trade() is called without any routes #52

Merged
merged 2 commits into from
Oct 13, 2023

Conversation

felipebrahm
Copy link
Collaborator

Without this additional throw, we were seeing a Cannot read property 'inputAmount' of undefined error in our frontend apps. This happens because router-sdk is doing const inputCurrency = this.swaps[0].inputAmount.currency without checking first if this.swaps[0] exists.

This new error message makes it easier to debug if it happens again.

@felipebrahm felipebrahm merged commit 59843a5 into main Oct 13, 2023
3 checks passed
@felipebrahm felipebrahm deleted the felipe/undefined-input-amount branch October 13, 2023 19:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants