]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Fix videos list when page is empty
authorChocobozzz <me@florianbigard.com>
Fri, 5 Oct 2018 15:07:13 +0000 (17:07 +0200)
committerChocobozzz <me@florianbigard.com>
Fri, 5 Oct 2018 15:07:13 +0000 (17:07 +0200)
client/src/app/shared/video/abstract-video-list.ts

index 6a758ebe02412338f1ac997f6ce886c0fa4d7069..7637911650ce28069b64dbcab9a92a9ce3ee4326 100644 (file)
@@ -83,7 +83,7 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy {
 
   pageByVideoId (index: number, page: Video[]) {
     // Video are unique in all pages
-    return page[0].id
+    return page.length !== 0 ? page[0].id : 0
   }
 
   videoById (index: number, video: Video) {