fix null pointer exception

This commit is contained in:
Kai DeLorenzo 2024-11-26 16:00:13 -05:00
parent 4d3acdb5fb
commit 809b99c9c9
No known key found for this signature in database

View file

@ -1322,7 +1322,14 @@ class VideoDetailView : ConstraintLayout {
this.video = video;
cleanupPlaybackTracker();
onVideoChanged.emit(video.video.videoSources[0].width, video.video.videoSources[0].height)
if (video.video.videoSources.isNotEmpty()) {
onVideoChanged.emit(
video.video.videoSources[0].width,
video.video.videoSources[0].height
)
} else {
onVideoChanged.emit(0, 0)
}
if (video is JSVideoDetails) {
val me = this;