diff options
author | Jay Merrifield <merrifieldj@pixia.com> | 2010-11-12 08:16:41 -0500 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2010-11-12 08:16:41 -0500 |
commit | dfb35442975a95c91f6c28188fad021714d7098b (patch) | |
tree | 381e657c01b1739f12d3439b5955cce9bf9fcd16 /ui/jquery.ui.dialog.js | |
parent | 320dfb86790571358db4a46d5b9d2a8278cf6024 (diff) | |
download | jquery-ui-dfb35442975a95c91f6c28188fad021714d7098b.tar.gz jquery-ui-dfb35442975a95c91f6c28188fad021714d7098b.zip |
Dialog: Make sure the overlay instance still exists before trying to remove it. Fixes #6645 - Dialog: Missing element not found check in overlay code.
Diffstat (limited to 'ui/jquery.ui.dialog.js')
-rw-r--r-- | ui/jquery.ui.dialog.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js index 3d38df4c0..efc445693 100644 --- a/ui/jquery.ui.dialog.js +++ b/ui/jquery.ui.dialog.js @@ -750,7 +750,10 @@ $.extend($.ui.dialog.overlay, { }, destroy: function($el) { - this.oldInstances.push(this.instances.splice($.inArray($el, this.instances), 1)[0]); + var indexOf = $.inArray($el, this.instances); + if (indexOf != -1){ + this.oldInstances.push(this.instances.splice(indexOf, 1)[0]); + } if (this.instances.length === 0) { $([document, window]).unbind('.dialog-overlay'); |