Fixed server crash bug when logging out.