mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-12 09:09:25 +00:00
Prevent getSaveFields from returning a property named undefined
Change-Id: Id7326ee8b951ba2219d3ea6767370ece9aba3c23
This commit is contained in:
parent
1cd761dad8
commit
212e5b231b
|
@ -817,7 +817,7 @@ ve.init.mw.ViewPageTarget.prototype.getSaveFields = function () {
|
|||
var $this = $( this );
|
||||
// We can't just use $this.val() because .val() always returns the value attribute of
|
||||
// a checkbox even when it's unchecked
|
||||
if ( $this.prop( 'type' ) !== 'checkbox' || $this.prop( 'checked' ) ) {
|
||||
if ( $this.prop ( 'name' ) && ( $this.prop( 'type' ) !== 'checkbox' || $this.prop( 'checked' ) ) ) {
|
||||
fields[$this.prop( 'name' )] = $this.val();
|
||||
}
|
||||
} );
|
||||
|
|
Loading…
Reference in a new issue