mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
9b3aebd310
commit
07fb756327
@ -575,7 +575,7 @@ jQuery.noConflict();
|
||||
this._super();
|
||||
},
|
||||
onremove: function() {
|
||||
this.button('destroy');
|
||||
if(this.data('button')) this.button('destroy');
|
||||
this._super();
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user