Trying to handle when earned achievements aren't created via POST.

This commit is contained in:
Nick Winter 2015-04-30 09:06:41 -07:00
parent e576557bba
commit 35726bf41c

View file

@ -93,7 +93,11 @@ class EarnedAchievementHandler extends Handler
)
else
EarnedAchievement.createForAchievement(achievement, trigger, null, null, (earnedAchievementDoc) =>
@sendCreated(res, earnedAchievementDoc.toObject())
if earnedAchievementDoc
@sendCreated(res, earnedAchievementDoc.toObject())
else
console.error "Couldn't create achievement", achievement, trigger
@sendNotFoundError res, "Couldn't create achievement"
)
)