diff --git a/src/HTMLBuilder/Manager/FileManager.php b/src/HTMLBuilder/Manager/FileManager.php
index c91330bd0..d8afcdb25 100755
--- a/src/HTMLBuilder/Manager/FileManager.php
+++ b/src/HTMLBuilder/Manager/FileManager.php
@@ -229,7 +229,12 @@ class FileManager implements ManagerInterface
Dropzone.autoDiscover = false;
$(document).ready(function() {
- var dragdrop = new Dropzone("#'.$attachment_id.' .dropzone", {
+ let dropzone_id = "#'.$attachment_id.' .dropzone";
+ if ($(dropzone_id).length == 0) {
+ return;
+ }
+
+ let dragdrop = new Dropzone(dropzone_id, {
dictDefaultMessage: "'.tr('Clicca o trascina qui per caricare uno o piĆ¹ file').'.
('.tr('Max upload: _SIZE_', [
'_SIZE_' => $upload_max_filesize.' MB',
]).')",