diff --git a/frappe/public/js/frappe/model/model.js b/frappe/public/js/frappe/model/model.js index 3742bab18e..6aa54c4dd4 100644 --- a/frappe/public/js/frappe/model/model.js +++ b/frappe/public/js/frappe/model/model.js @@ -157,8 +157,14 @@ $.extend(frappe.model, { if (frappe.model.docinfo[comment.comment_doctype] && frappe.model.docinfo[comment.comment_doctype][comment.comment_docname]) { var comments = frappe.model.docinfo[comment.comment_doctype][comment.comment_docname].comments; - var comment_exists = !!$.map(comments, - function(x) { return x.name == comment.name? true : undefined}).length + + var comment_exists = false; + for (var i=0, l=comments.length; i