Skip to content

Commit 74cb414

Browse files
Handle lockup views with no published text or views (#8170)
Co-authored-by: absidue <[email protected]>
1 parent d51c8d3 commit 74cb414

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/renderer/helpers/api/local.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1538,13 +1538,13 @@ function parseLockupView(lockupView, channelId = undefined, channelName = undefi
15381538
lengthSeconds = Utils.timeToSeconds(durationBadge.text)
15391539
}
15401540

1541-
publishedText = lockupView.metadata.metadata?.metadata_rows[1].metadata_parts.find(part => part.text?.text?.endsWith('ago'))?.text?.text
1541+
publishedText = lockupView.metadata.metadata?.metadata_rows[1].metadata_parts?.find(part => part.text?.text?.endsWith('ago'))?.text?.text
15421542
}
15431543
}
15441544

15451545
let viewCount = null
15461546

1547-
const viewsText = lockupView.metadata.metadata?.metadata_rows[1].metadata_parts.find(part => {
1547+
const viewsText = lockupView.metadata.metadata?.metadata_rows[1].metadata_parts?.find(part => {
15481548
return part.text?.text && VIEWS_OR_WATCHING_REGEX.test(part.text.text)
15491549
})?.text?.text
15501550

0 commit comments

Comments
 (0)