forbole / forbole-x

A multichain asset management platform.
https://www.forbole.com/products
Apache License 2.0
21 stars 15 forks source link

fix(#684): Fix crashing when undelegating #686

Closed Moistbobo closed 2 years ago

Moistbobo commented 2 years ago

This PR fixes the crashing that occurs when undelegating.

Closes #684

The crash occurs when the user undelegates all the staked tokens from a validator.

The reason behind the crash is a null error that happens when the app updates the user's staked tokens following an undelegation action. In this case, the Undelegate window does not close fast enough, and tries to reference the staked amount for the validator that the user was trying to undelegate from, resulting in a crash as those staked tokens technically do not exist anymore, as they have been undelegated.