From ee6064eee8fe2d6b5eb5c6bc6abef9f64e694bd2 Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Mon, 3 Jan 2022 23:28:05 +0900 Subject: [PATCH 1/2] Don't unwrap() --- src/template_utils.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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), From e398f36c5799c8efb26844f12101f2714ee2828e Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Mon, 3 Jan 2022 23:28:56 +0900 Subject: [PATCH 2/2] Add changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) 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