mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-13 20:57:24 +01:00
fix(join group): do not throw if inviter has does not exist
This commit is contained in:
@@ -607,9 +607,11 @@ api.joinGroup = {
|
|||||||
|
|
||||||
let promises = [group.save(), user.save()];
|
let promises = [group.save(), user.save()];
|
||||||
|
|
||||||
if (inviter) {
|
// Load the inviter
|
||||||
inviter = await User.findById(inviter).exec();
|
if (inviter) inviter = await User.findById(inviter).exec();
|
||||||
|
|
||||||
|
// Check the inviter again, could be a deleted account
|
||||||
|
if (inviter) {
|
||||||
const data = {
|
const data = {
|
||||||
headerText: common.i18n.t('invitationAcceptedHeader', inviter.preferences.language),
|
headerText: common.i18n.t('invitationAcceptedHeader', inviter.preferences.language),
|
||||||
bodyText: common.i18n.t('invitationAcceptedBody', {
|
bodyText: common.i18n.t('invitationAcceptedBody', {
|
||||||
|
|||||||
Reference in New Issue
Block a user