diff --git a/src/js/bootstrap-datetimepicker.js b/src/js/bootstrap-datetimepicker.js
index <HASH>..<HASH> 100644
--- a/src/js/bootstrap-datetimepicker.js
+++ b/src/js/bootstrap-datetimepicker.js
@@ -851,7 +851,8 @@
             detachDatePickerGlobalEvents();
             picker.widget.remove();
             picker.element.removeData('DateTimePicker');
-            picker.component.removeData('DateTimePicker');
+            if (picker.component)
+                picker.component.removeData('DateTimePicker');
         };
 
         picker.show = function (e) {
Fixed an exception on destroy() if the element isn't an <input>