diff --git a/js/auto-save-form.js b/js/auto-save-form.js
index c9b43a7..66dd506 100644
--- a/js/auto-save-form.js
+++ b/js/auto-save-form.js
@@ -10,12 +10,14 @@
         $('#' + index).autosaveform();
       });
       //Fix for ckeditor
-      for (var i in CKEDITOR.instances) {
-        CKEDITOR.instances[i].on('change', function () {
-          if (form_ids.indexOf($($(CKEDITOR.instances["edit-body-0-value"].element.$.form)).find("input[name=form_id]").val().replaceAll("_", "-") !== false)) {
-            jQuery("#" + CKEDITOR.instances[i].name).val(CKEDITOR.instances[i].getData()).trigger("change");
-          }
-        });
+      if (typeof CKEDITOR !== 'undefined') {
+        for (var i in CKEDITOR.instances) {
+          CKEDITOR.instances[i].on('change', function () {
+            if (form_ids.indexOf($($(CKEDITOR.instances["edit-body-0-value"].element.$.form)).find("input[name=form_id]").val().replaceAll("_", "-") !== false)) {
+              jQuery("#" + CKEDITOR.instances[i].name).val(CKEDITOR.instances[i].getData()).trigger("change");
+            }
+          });
+        }
       }
     }
   };
