Skip to content

Commit cc0fc9c

Browse files
author
zhenya
committed
Added parser
1 parent f1b7f84 commit cc0fc9c

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

src/main/java/com/iusenko/subrip/SubripParser.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,18 @@ protected Phrase next() throws IOException, PhraseParserException {
5050

5151
public List<Phrase> load() throws IOException, PhraseParserException {
5252
phrases = new ArrayList<Phrase>();
53+
5354
Phrase phrase = null;
54-
while ((phrase = next()) != null) {
55+
while (true) {
56+
try {
57+
phrase = next();
58+
} catch (Exception e) {
59+
e.printStackTrace();
60+
continue;
61+
}
62+
if (phrase == null) {
63+
break;
64+
}
5565
phrases.add(phrase);
5666
}
5767
return phrases;

0 commit comments

Comments
 (0)