Fix handling of absent license URLs

Before, if an option was picked that has no license URL field, it
would submit undefined for license_url. Now it correctly omits the key.
This commit is contained in:
Alex Liebowitz 2016-09-21 02:57:20 -04:00
parent 28e7f1e3b2
commit 5476c29322

View file

@ -287,7 +287,7 @@ var PublishPage = React.createClass({
} else if (this.state.otherLicenseChosen) { } else if (this.state.otherLicenseChosen) {
return this.state.otherLicenseUrl; return this.state.otherLicenseUrl;
} else { } else {
return this.refs.meta_license.getSelectedElement().getAttribute('data-url'); return this.refs.meta_license.getSelectedElement().getAttribute('data-url') || '' ;
} }
}, },
componentDidMount: function() { componentDidMount: function() {