Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: crash when spend limit not set #651

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jim380
Copy link

@jim380 jim380 commented Jan 16, 2025

Problem

The application was crashing with the error:

TypeError: Cannot read properties of undefined (reading 'denom')

This occurred when a feegrant was created without a spend limit using the command provider-services tx feegrant grant main X --expiration "Y".

Solution

Added null checks and fallback UI for undefined spend limits in authorization components:

  • Added optional chaining for spend_limit access in AllowanceGrantedRow
  • Added optional chaining for spend_limit access in AllowanceIssuedRow
  • Added optional chaining for spend_limit access in GranteeRow
  • Added "Unlimited" display text when no spend limit exists

Testing

  • Verified handling of feegrants with no spend limit
  • Confirmed display of "Unlimited" text for unlimited grants
  • Tested both limited and unlimited feegrant scenarios

Related Issues

Closes #609

@jim380 jim380 requested a review from a team as a code owner January 16, 2025 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash on /settings/authorizations
1 participant