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-description').textContent = data.description;
$('.meta-author').parentNode.style.display = data.author ? '' : 'none';
$('.meta-author').textContent = '';
$('.meta-author').appendChild(makeAuthor(data.author));
if (data.author) {
$('.meta-author').parentNode.style.display = '';
$('.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').textContent = data.license;