From a4f2912fdf5e0945d89fe588f5cb6b02cc3c2582 Mon Sep 17 00:00:00 2001 From: Suraj Shetty Date: Mon, 13 Jun 2022 11:11:47 +0530 Subject: [PATCH] fix: Handle case where document title can be NONE (cherry picked from commit 9b67fc24bc290789158f37a8f2ce10b505878792) --- frappe/www/printview.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/www/printview.py b/frappe/www/printview.py index 85ffc671fa..c8595a6f2c 100644 --- a/frappe/www/printview.py +++ b/frappe/www/printview.py @@ -63,7 +63,7 @@ def get_context(context): "body": body, "print_style": print_style, "comment": frappe.session.user, - "title": frappe.utils.strip_html(doc.get_title()), + "title": frappe.utils.strip_html(doc.get_title() or doc.name), "lang": frappe.local.lang, "layout_direction": "rtl" if is_rtl() else "ltr", "doctype": frappe.form_dict.doctype,