From 9ca5728be138fad03a63b6701cd4164a9433509d Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 21 Mar 2022 09:11:11 +0100 Subject: [PATCH] Fix channel edition page --- client/src/app/shared/shared-main/account/actor.model.ts | 2 +- .../shared/shared-main/video-channel/video-channel.model.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/client/src/app/shared/shared-main/account/actor.model.ts b/client/src/app/shared/shared-main/account/actor.model.ts index bd693860d..977fdb7e5 100644 --- a/client/src/app/shared/shared-main/account/actor.model.ts +++ b/client/src/app/shared/shared-main/account/actor.model.ts @@ -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) } } diff --git a/client/src/app/shared/shared-main/video-channel/video-channel.model.ts b/client/src/app/shared/shared-main/video-channel/video-channel.model.ts index e22b0cfd0..32376bf62 100644 --- a/client/src/app/shared/shared-main/video-channel/video-channel.model.ts +++ b/client/src/app/shared/shared-main/video-channel/video-channel.model.ts @@ -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 -- 2.41.0