fix: Properly parse null values api (#230)

Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
PartyDonut 2025-02-16 13:39:32 +01:00 committed by GitHub
parent 492857a8ad
commit 3d82207694
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 5 deletions

View file

@ -104,7 +104,7 @@ class VideoStream {
final MediaStreamsModel? mediaStreamsModel;
AudioStreamModel? get currentAudioStream {
if (audioStreamIndex == -1) {
if (audioStreamIndex == -1 || audioStreamIndex == null) {
return null;
}
return mediaStreamsModel?.audioStreams.firstWhereOrNull(
@ -112,7 +112,7 @@ class VideoStream {
}
SubStreamModel? get currentSubStream {
if (subtitleStreamIndex == -1) {
if (subtitleStreamIndex == -1 || subtitleStreamIndex == null) {
return null;
}
return mediaStreamsModel?.subStreams.firstWhereOrNull(