Skip to content

Commit

Permalink
fix: prevent type error when video doesn't exist
Browse files Browse the repository at this point in the history
Since I stop video no matter the index passed to select(), I have to
check whether the sought item exists.
  • Loading branch information
daelmaak committed Sep 10, 2023
1 parent ed793f9 commit 1c12e47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libs/gallery/src/lib/components/viewer/viewer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export class ViewerComponent implements OnChanges, OnInit, AfterViewInit {
return this.center();
}

if (this.items[this.selectedIndex].video) {
if (this.items[this.selectedIndex]?.video) {
this.stopCurrentVideo();
}

Expand Down

0 comments on commit 1c12e47

Please sign in to comment.