Skip to content

Commit

Permalink
Fix video publish date element query null check
Browse files Browse the repository at this point in the history
  • Loading branch information
romanzipp committed Aug 14, 2024
1 parent f0ef37b commit da64c86
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/common/utility.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ export function getYouTubePlayerProgressBar() {
}

export function getCurrentVideoPublishDate() {
const ldScript = document.querySelector('#microformat script[type="application/ld+json"]').innerHTML;
const ldScript = document.querySelector('#microformat script[type="application/ld+json"]');

if (ldScript) {
try {
const ldData = JSON.parse(ldScript);
const ldData = JSON.parse(ldScript.innerHTML);
return moment(ldData.uploadDate);
} catch (err) {
return null;
Expand Down

0 comments on commit da64c86

Please sign in to comment.