Added null coalescence checks to video info

This commit is contained in:
Ajay Ramachandran
2020-05-11 20:45:48 -04:00
parent 70239bc045
commit c68aabaa40
2 changed files with 9 additions and 4 deletions

View File

@@ -161,7 +161,7 @@ class SubmissionNoticeComponent extends React.Component<SubmissionNoticeProps, S
}
// Check if any non music categories are being used on a music video
if (this.contentContainer().videoInfo.microformat.playerMicroformatRenderer.category === "Music") {
if (this.contentContainer().videoInfo?.microformat?.playerMicroformatRenderer?.category === "Music") {
let sponsorTimesSubmitting = this.props.contentContainer().sponsorTimesSubmitting;
for (const sponsorTime of sponsorTimesSubmitting) {
if (!sponsorTime.category.startsWith("music_")) {