After some discussion on the thread, this is probably the neatest solution to issue #6758. I have also modified the code on the guild controller, which displayed the very same problem when pressing the 'Leave' button to leave a guild.