From 88d58abfc3df8d38ea631a12457c4de90bee0271 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 8 Feb 2011 11:12:26 +0000 Subject: [PATCH] Don't throw JS error when AJAX license selection is on but there's no license selector because this is a re-upload. --- skins/common/upload.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; -- 2.20.1