diff --git a/CHANGELOG.md b/CHANGELOG.md index efa29287..272dcd39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ ## [Unreleased] - ReleaseDate +### Fiexed + +- Fix a bug that notification page doesn't show + ## [[0.7.0]] - 2022-01-02 ### Added diff --git a/src/template_utils.rs b/src/template_utils.rs index 9266aa52..de1e18ac 100644 --- a/src/template_utils.rs +++ b/src/template_utils.rs @@ -100,7 +100,9 @@ macro_rules! render { } pub fn translate_notification(ctx: BaseContext<'_>, notif: Notification) -> String { - let name = notif.get_actor(ctx.0).unwrap().name(); + let name = notif + .get_actor(ctx.0) + .map_or_else(|_| i18n!(ctx.1, "Someone"), |user| user.name()); match notif.kind.as_ref() { notification_kind::COMMENT => i18n!(ctx.1, "{0} commented on your article."; &name), notification_kind::FOLLOW => i18n!(ctx.1, "{0} is subscribed to you."; &name),