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 a php warning for new users #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gturri
Copy link

@gturri gturri commented Mar 31, 2022

Without this "isset" we get a php warning because for users who just registered
$user is null (and we try to get the field 'uid' on a null object).
(I don't know if this warning was always here or if it appears only on recent
versions of Q2A)

Note that this fix is just the same code that is used on L113 of this file
where we check if we have the field 'points'

Nb: I have no idea why we don't have a similar warning on the lines where we
try to access the other fields of $user (eg: L67, L71, ...), that's why
I don't try to fix anything there

Without this "isset" we get a php warning because for users who just registered
$user is null (and we try to get the field 'uid' on a null object).
(I don't know if this warning was always here or if it appears only on recent
versions of Q2A)

Note that this fix is just the same code that is used on L113 of this file
where we check if we have the field 'points'

Nb: I have no idea why we don't have a similar warning on the lines where we
    try to access the other fields of $user (eg: L67, L71, ...), that's why
    I don't try to fix anything there
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.

1 participant