diff --git a/js/dialog/dialog.ajax.js b/js/dialog/dialog.ajax.js
index 63850b1..41d5bfc 100644
--- a/js/dialog/dialog.ajax.js
+++ b/js/dialog/dialog.ajax.js
@@ -40,12 +40,14 @@
         $dialog.dialog('widget').trigger('focus');
       }
 
-      var originalClose = settings.dialog.close;
-      // Overwrite the close method to remove the dialog on closing.
-      settings.dialog.close = function (event) {
-        originalClose.apply(settings.dialog, arguments);
-        $(event.target).remove();
-      };
+      if (settings.hasOwnProperty('dialog')) {
+        var originalClose = settings.dialog.close;
+        // Overwrite the close method to remove the dialog on closing.
+        settings.dialog.close = function (event) {
+          originalClose.apply(settings.dialog, arguments);
+          $(event.target).remove();
+        };
+      }
     },
 
     /**
