diff --git a/view/theme/frio/js/modal.js b/view/theme/frio/js/modal.js index c7159018df..b62736a86a 100644 --- a/view/theme/frio/js/modal.js +++ b/view/theme/frio/js/modal.js @@ -270,11 +270,15 @@ function editpost(url) { // To make dropzone fileupload work on editing a comment, we need to // attach a new dropzone to modal - dzFactory.setupDropzone('#jot-text-wrap', 'profile-jot-text'); + if ($('#jot-text-wrap').length > 0) { + dzFactory.setupDropzone('#jot-text-wrap', 'profile-jot-text'); + } modal.show(); $("#jot-popup").show(); - linkPreview = $("#profile-jot-text").linkPreview(); + if ($("#profile-jot-text").length > 0) { + linkPreview = $("#profile-jot-text").linkPreview(); + } } }); }