Skip to content

Commit 6a0f6e8

Browse files
committed
Fix possible bug when language.id field is not present and this the languageCode an empty String.
1 parent b9282bb commit 6a0f6e8

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/services/peertube/extractors/PeertubeStreamExtractor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import java.util.Locale;
3434

3535
import static org.schabi.newpipe.extractor.utils.Utils.UTF_8;
36+
import static org.schabi.newpipe.extractor.utils.Utils.isNullOrEmpty;
3637

3738
public class PeertubeStreamExtractor extends StreamExtractor {
3839
private final String baseUrl;
@@ -400,7 +401,7 @@ private void loadSubtitles() {
400401
final String languageCode = JsonUtils.getString(caption, "language.id");
401402
final String ext = url.substring(url.lastIndexOf(".") + 1);
402403
final MediaFormat fmt = MediaFormat.getFromSuffix(ext);
403-
if (fmt != null && languageCode != null)
404+
if (fmt != null && !isNullOrEmpty(languageCode))
404405
subtitles.add(new SubtitlesStream(fmt, languageCode, url, false));
405406
}
406407
}

0 commit comments

Comments
 (0)