]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Fix channel edition page
authorChocobozzz <me@florianbigard.com>
Mon, 21 Mar 2022 08:11:11 +0000 (09:11 +0100)
committerChocobozzz <me@florianbigard.com>
Mon, 21 Mar 2022 08:11:11 +0000 (09:11 +0100)
client/src/app/shared/shared-main/account/actor.model.ts
client/src/app/shared/shared-main/video-channel/video-channel.model.ts

index bd693860d77ec6f2fe2fd4f4b46bfea2ae1aab41..977fdb7e53215ea1b112c10069a07934c7295de3 100644 (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)
   }
 }
index e22b0cfd0360c4f37485dfa7ea4e0e3ab866bd0d..32376bf625d554f93daee5adb56436c742aa4f3f 100644 (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