check if #ppcp-hide-dcc exists before attempting to remove it

This commit is contained in:
David Remer 2020-09-28 14:54:52 +03:00
parent a609b6f90b
commit 44e72816b9

View file

@ -28,7 +28,11 @@ class CreditCardRenderer {
const gateWayBox = document.querySelector('.payment_box.payment_method_ppcp-credit-card-gateway');
const oldDisplayStyle = gateWayBox.style.display;
gateWayBox.style.display = 'block';
document.querySelector('#ppcp-hide-dcc').parentNode.removeChild(document.querySelector('#ppcp-hide-dcc'));
const hideDccGateway = document.querySelector('#ppcp-hide-dcc');
if (hideDccGateway) {
hideDccGateway.parentNode.removeChild(hideDccGateway);
}
const cardNumberField = document.querySelector('#ppcp-credit-card-gateway-card-number');