Fix edge case in which uninitialized buttons are being destroyed.

In certain cases, the button may not yet be initialized or may no longer have button properties at the time of removal from the DOM. Without this check, an uncaught exception is thrown.
This commit is contained in:
unclecheese 2012-12-18 09:41:54 -05:00
parent 9b3aebd310
commit 07fb756327

View File

@ -575,7 +575,7 @@ jQuery.noConflict();
this._super();
},
onremove: function() {
this.button('destroy');
if(this.data('button')) this.button('destroy');
this._super();
}
});