diff --git a/web_dialog_size/static/src/js/web_dialog_size.js b/web_dialog_size/static/src/js/web_dialog_size.js index f1684791..13e9484a 100644 --- a/web_dialog_size/static/src/js/web_dialog_size.js +++ b/web_dialog_size/static/src/js/web_dialog_size.js @@ -36,9 +36,11 @@ Dialog.include({ }, close: function() { - var draggable = this.$modal.draggable( "instance" ); - if (draggable) { - this.$modal.draggable("destroy"); + if (this.$modal) { + var draggable = this.$modal.draggable("instance"); + if (draggable) { + this.$modal.draggable("destroy"); + } } return this._super.apply(this, arguments); },