Fix channel edition page

pull/4897/head
Chocobozzz 2022-03-21 09:11:11 +01:00
parent b4a4bcd20e
commit 9ca5728be1
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 5 additions and 3 deletions

View File

@ -55,7 +55,7 @@ export abstract class Actor implements ServerActor {
if (hash.createdAt) this.createdAt = new Date(hash.createdAt.toString())
this.avatars = hash.avatars
this.avatars = hash.avatars || []
this.isLocal = Actor.IS_LOCAL(this.host)
}
}

View File

@ -33,7 +33,9 @@ export class VideoChannel extends Actor implements ServerVideoChannel {
}
static GET_ACTOR_BANNER_URL (channel: ServerVideoChannel) {
if (!channel) return ''
if (!channel || channel.banners.length === 0) {
return ''
}
const banner = channel.banners[0]
if (!banner) return ''
@ -57,7 +59,7 @@ export class VideoChannel extends Actor implements ServerVideoChannel {
this.description = hash.description
this.support = hash.support
this.banners = hash.banners
this.banners = hash.banners || []
this.isLocal = hash.isLocal