Skip to content

Commit

Permalink
refactor: catch exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
scmmishra committed Aug 10, 2020
1 parent ce9c23b commit 64f913f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion frappe/public/js/frappe/form/formatters.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,14 @@ frappe.form.formatters = {
TextEditor: function(value) {
let formatted_value = frappe.form.formatters.Text(value);
// to use ql-editor styles
if (!$(formatted_value).find('.ql-editor').length) {
try {
if (!$(formatted_value).find('.ql-editor').length) {
formatted_value = `<div class="ql-editor read-mode">${formatted_value}</div>`;
}
} catch(e) {
formatted_value = `<div class="ql-editor read-mode">${formatted_value}</div>`;
}

return formatted_value;
},
Code: function(value) {
Expand Down

0 comments on commit 64f913f

Please sign in to comment.