zxy19 / flarum-invite-user

GNU General Public License v3.0
2 stars 0 forks source link

Possible PHP warning when invalid invitation code is supplied #1

Open clarkwinkelmann opened 2 months ago

clarkwinkelmann commented 2 months ago

Hi, congratulation for these impressive new extensions!

I haven't tried the extension, but I was reading through the source code and noticed this part:

https://github.com/zxy19/flarum-invite-user/blob/e1d2ade32fd87601d9ffd49b5e257d99ca980d14/src/ForumRelation.php#L45-L46

I believe this will throw a PHP warning "unable to access property on null" if an invalid code is supplied in the URL, due to $invite being null when $invite->user is called.

zxy19 commented 2 months ago

Thank you for correcting my mistake! I'v upload a new version and add a check to the $invite variable.