fix: check if frm is available

Prevents error when creating new Communication from list view.
This commit is contained in:
barredterra 2021-01-27 18:59:00 +01:00 committed by Suraj Shetty
parent 46c5e30185
commit 90819667cf

View file

@ -196,7 +196,10 @@ frappe.views.CommunicationComposer = Class.extend({
this.setup_last_edited_communication();
this.setup_email_template();
this.dialog.set_value("email_template", this.frm.meta.default_email_template || '');
if ('frm' in this) {
this.dialog.set_value("email_template", this.frm.meta.default_email_template || '');
}
this.dialog.set_value("recipients", this.recipients || '');
this.dialog.set_value("cc", this.cc || '');
this.dialog.set_value("bcc", this.bcc || '');