From: Brion Vibber Date: Tue, 8 Feb 2011 11:12:26 +0000 (+0000) Subject: Don't throw JS error when AJAX license selection is on but there's no license selecto... X-Git-Tag: 1.31.0-rc.0~32122 X-Git-Url: http://git.cyclocoop.org/wiki/Target_page?a=commitdiff_plain;h=88d58abfc3df8d38ea631a12457c4de90bee0271;p=lhc%2Fweb%2Fwiklou.git Don't throw JS error when AJAX license selection is on but there's no license selector because this is a re-upload. --- diff --git a/skins/common/upload.js b/skins/common/upload.js index c91482b60d..4185ec9b8a 100644 --- a/skins/common/upload.js +++ b/skins/common/upload.js @@ -59,12 +59,12 @@ window.wgUploadSetup = function() { row.appendChild( td ); } - if ( wgAjaxLicensePreview ) { + var wpLicense = document.getElementById( 'wpLicense' ); + if ( wgAjaxLicensePreview && wpLicense ) { // License selector check - document.getElementById( 'wpLicense' ).onchange = licenseSelectorCheck; + wpLicense.onchange = licenseSelectorCheck; // License selector table row - var wpLicense = document.getElementById( 'wpLicense' ); var wpLicenseRow = wpLicense.parentNode.parentNode; var wpLicenseTbody = wpLicenseRow.parentNode;