Fix: TypeError when missing author meta

This commit is contained in:
eight 2017-10-07 18:04:37 +08:00
parent fc51d806da
commit 40a1781a53

View File

@ -70,9 +70,13 @@
$('.meta-version').textContent = data.version; $('.meta-version').textContent = data.version;
$('.meta-description').textContent = data.description; $('.meta-description').textContent = data.description;
$('.meta-author').parentNode.style.display = data.author ? '' : 'none'; if (data.author) {
$('.meta-author').textContent = ''; $('.meta-author').parentNode.style.display = '';
$('.meta-author').appendChild(makeAuthor(data.author)); $('.meta-author').textContent = '';
$('.meta-author').appendChild(makeAuthor(data.author));
} else {
$('.meta-author').parentNode.style.display = 'none';
}
$('.meta-license').parentNode.style.display = data.license ? '' : 'none'; $('.meta-license').parentNode.style.display = data.license ? '' : 'none';
$('.meta-license').textContent = data.license; $('.meta-license').textContent = data.license;