mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-28 16:20:52 +00:00
Merge "Check values property exists before removing attribute"
This commit is contained in:
commit
fc3ea799df
|
@ -279,9 +279,11 @@ ve.dm.Model.static.removeHtmlAttribute = function ( dataElement, attribute ) {
|
|||
function removeAttributeRecursive( children ) {
|
||||
var i;
|
||||
for ( i = 0; i < children.length; i++ ) {
|
||||
delete children[i].values[attribute];
|
||||
if ( ve.isEmptyObject( children[i].values ) ) {
|
||||
delete children[i].values;
|
||||
if ( children[i].values ) {
|
||||
delete children[i].values[attribute];
|
||||
if ( ve.isEmptyObject( children[i].values ) ) {
|
||||
delete children[i].values;
|
||||
}
|
||||
}
|
||||
if ( children[i].children ) {
|
||||
removeAttributeRecursive( children[i].children );
|
||||
|
|
Loading…
Reference in a new issue