Skip to content

Commit 93d0120

Browse files
committed
Accordion - Make sure we have an element before trying to modify the className. Fixes #6856 - Accordion: Opening a panel after all panels have been collapsed causes an error.
1 parent 599e143 commit 93d0120

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ui/jquery.ui.accordion.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,9 @@ $.widget( "ui.accordion", {
488488
// other classes are removed before the animation; this one needs to stay until completed
489489
this.toHide.removeClass( "ui-accordion-content-active" );
490490
// Work around for rendering bug in IE (#5421)
491-
this.toHide.parent()[0].className = this.toHide.parent()[0].className;
491+
if ( this.toHide.length ) {
492+
this.toHide.parent()[0].className = this.toHide.parent()[0].className;
493+
}
492494

493495
this._trigger( "change", null, this.data );
494496
}

0 commit comments

Comments
 (0)