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(user): properly handle null param in whereName() #3142

Merged
merged 2 commits into from
Jan 28, 2025

Conversation

wescopeland
Copy link
Member

Resolves https://discord.com/channels/310192285306454017/1333204742427377684.

Currently, if the given display name param is null, the first user on the table (Scott) will get grabbed instead, ie:

$this->userContext = User::whereName($targetUsername)->first() ?? Auth::user() ?? null;

In the case of the bug reported, $targetUsername is null, so Scott's user record is being pulled by the query.

@wescopeland wescopeland requested a review from a team January 26, 2025 23:08
@wescopeland wescopeland merged commit 389af48 into RetroAchievements:master Jan 28, 2025
8 checks passed
@wescopeland wescopeland deleted the where-name-null-fix branch January 28, 2025 22:30
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.

2 participants