Core/Guilds: Fixed a possible crash on guild invite.

Closes #8699