! Fix handling of `channel.subscriber.text` being `undefined` (#3340)

This commit is contained in:
PikachuEXE 2023-03-23 03:10:34 +08:00 committed by GitHub
parent 6513b5d517
commit f0ba90e766
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -54,7 +54,7 @@ export default defineComponent({
this.channelName = this.data.name
this.id = this.data.id
if (this.hideChannelSubscriptions || this.data.subscribers === null) {
if (this.hideChannelSubscriptions || this.data.subscribers == null) {
this.subscriberCount = null
} else {
this.subscriberCount = this.data.subscribers.replace(/ subscriber(s)?/, '')

View File

@ -370,7 +370,7 @@ function parseListItem(item) {
let subscribers = null
let videos = null
let handle = null
if (channel.subscribers.text.startsWith('@')) {
if (channel.subscribers.text?.startsWith('@')) {
handle = channel.subscribers.text
if (channel.videos.text !== 'N/A') {