Check for meta payment pointer first before attempting to load (#9722)

This commit is contained in:
Andy Zhao 2020-08-10 18:12:48 -04:00 committed by GitHub
parent d200959809
commit f4b50a11b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,9 +3,9 @@ function initializePaymentPointers() {
var basePointer = document.getElementById('base-payment-pointer');
var meta = document.querySelector("meta[name='monetization']");
if (userPointer) {
if (userPointer && meta) {
meta.content = userPointer.dataset.paymentPointer;
} else if (basePointer) {
meta.content = basePointer.dataset.paymentPointer;;
meta.content = basePointer.dataset.paymentPointer;
}
}