From 0cdbdffb8ce27d28d6a330b5a22449d402e42eb9 Mon Sep 17 00:00:00 2001 From: MeiK Date: Tue, 22 Oct 2019 17:54:44 +0800 Subject: [PATCH] Update --- layouts/partials/script.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/layouts/partials/script.html b/layouts/partials/script.html index 8b20748..314dec0 100644 --- a/layouts/partials/script.html +++ b/layouts/partials/script.html @@ -10,14 +10,18 @@ const pinned_posts = document.getElementsByName('pinned-post'); for (let i = 0; i < pinned_posts.length; i++) { for (let j = 0; j < classs.length; j++) { - pinned_posts[i].getElementsByTagName('p')[0].classList.add(classs[j]); + try { + pinned_posts[i].getElementsByTagName('p')[0].classList.add(classs[j]); + } catch {} } } classs = [/*'col-9', */'d-inline-block', 'text-gray', 'mb-2', 'pr-4']; const posts_posts = document.getElementsByName('posts-post'); for (let i = 0; i < posts_posts.length; i++) { for (let j = 0; j < classs.length; j++) { - posts_posts[i].getElementsByTagName('p')[0].classList.add(classs[j]); + try { + posts_posts[i].getElementsByTagName('p')[0].classList.add(classs[j]); + } catch {} } } \ No newline at end of file