Merge pull request #3185 from dbrain/subrip_timing_line_crash
Fix possible subrip timing line NPE
This commit is contained in:
commit
7ddcc46cbd
@ -69,8 +69,8 @@ public final class SubripDecoder extends SimpleSubtitleDecoder {
|
|||||||
// Read and parse the timing line.
|
// Read and parse the timing line.
|
||||||
boolean haveEndTimecode = false;
|
boolean haveEndTimecode = false;
|
||||||
currentLine = subripData.readLine();
|
currentLine = subripData.readLine();
|
||||||
Matcher matcher = SUBRIP_TIMING_LINE.matcher(currentLine);
|
Matcher matcher = currentLine == null ? null : SUBRIP_TIMING_LINE.matcher(currentLine);
|
||||||
if (matcher.matches()) {
|
if (matcher != null && matcher.matches()) {
|
||||||
cueTimesUs.add(parseTimecode(matcher, 1));
|
cueTimesUs.add(parseTimecode(matcher, 1));
|
||||||
if (!TextUtils.isEmpty(matcher.group(6))) {
|
if (!TextUtils.isEmpty(matcher.group(6))) {
|
||||||
haveEndTimecode = true;
|
haveEndTimecode = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user