mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-12-01 09:26:37 +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 ) {
|
function removeAttributeRecursive( children ) {
|
||||||
var i;
|
var i;
|
||||||
for ( i = 0; i < children.length; i++ ) {
|
for ( i = 0; i < children.length; i++ ) {
|
||||||
delete children[i].values[attribute];
|
if ( children[i].values ) {
|
||||||
if ( ve.isEmptyObject( children[i].values ) ) {
|
delete children[i].values[attribute];
|
||||||
delete children[i].values;
|
if ( ve.isEmptyObject( children[i].values ) ) {
|
||||||
|
delete children[i].values;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ( children[i].children ) {
|
if ( children[i].children ) {
|
||||||
removeAttributeRecursive( children[i].children );
|
removeAttributeRecursive( children[i].children );
|
||||||
|
|
Loading…
Reference in a new issue