Permalink
Browse files

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.
  • Loading branch information...
1 parent 13ca484 commit a7aa65d1fcbb21f6591985d05e147daa23df60d5 @scottgonzalez scottgonzalez committed Jan 13, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 ui/jquery.ui.accordion.js
@@ -504,7 +504,9 @@ $.widget( "ui.accordion", {
// other classes are removed before the animation; this one needs to stay until completed
this.toHide.removeClass( "ui-accordion-content-active" );
// Work around for rendering bug in IE (#5421)
- this.toHide.parent()[0].className = this.toHide.parent()[0].className;
+ if ( this.toHide.length ) {
+ this.toHide.parent()[0].className = this.toHide.parent()[0].className;
+ }
this._trigger( "change", null, this.data );
}

0 comments on commit a7aa65d

Please sign in to comment.