diff --git a/app/tasks/emails.py b/app/tasks/emails.py
index 602a089d..db2cc22a 100644
--- a/app/tasks/emails.py
+++ b/app/tasks/emails.py
@@ -140,7 +140,7 @@ def send_notification_digest(notifications: [Notification], locale):
 		return
 
 	with force_locale(locale or "en"):
-		msg = Message(gettext("%(num)d new notifications", len(notifications)), recipients=[user.email])
+		msg = Message(gettext("%(num)d new notifications", num=len(notifications)), recipients=[user.email])
 
 		msg.body = "".join(["<{}> {}\n{}: {}\n\n".format(notification.causer.display_name, notification.title, gettext("View"), abs_url(notification.url)) for notification in notifications])
 
diff --git a/app/utils/flask.py b/app/utils/flask.py
index 3947591d..b8a467d8 100644
--- a/app/utils/flask.py
+++ b/app/utils/flask.py
@@ -45,6 +45,9 @@ def abs_url_samesite(path):
 	return urlunparse(base._replace(path=path))
 
 def url_current(abs=False):
+	if request.args is None or request.view_args is None:
+		return None
+
 	args = MultiDict(request.args)
 	dargs = dict(args.lists())
 	dargs.update(request.view_args)