This line threw me an exception becuase "this.component" was set to false befor.
I fixed this simply editing this line to:

this.isDropup = this.component && this.component.hasClass('dropup') || this.element.hasClass('dropup');