Skip to content

Return early in removeBalance and getUserBalance for null userProfile - #53

Merged
konnatoad merged 1 commit into
mainfrom
fix/store-null-profile-crash
May 27, 2026
Merged

Return early in removeBalance and getUserBalance for null userProfile#53
konnatoad merged 1 commit into
mainfrom
fix/store-null-profile-crash

Conversation

@konnatoad

Copy link
Copy Markdown
Owner

Adds early returns in removeBalance and getUserBalance when userProfile is null, preventing an uncaught crash on userProfile.balance. Both helpers now fail gracefully — removeBalance returns false and getUserBalance returns 0, which the existing caller checks already handle correctly.

Closes #48

@konnatoad
konnatoad requested a review from preclusion May 27, 2026 01:21
@konnatoad konnatoad self-assigned this May 27, 2026
@konnatoad konnatoad added the bug Something isn't working label May 27, 2026

@preclusion preclusion left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@konnatoad
konnatoad merged commit ae53c1d into main May 27, 2026
3 checks passed
@konnatoad
konnatoad deleted the fix/store-null-profile-crash branch May 27, 2026 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: removeBalance crashes if userProfile is null

2 participants