q2a-badges
q2a-badges copied to clipboard
Fix a php warning for new users
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