mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-14 08:40:29 +00:00
Fix StringIndexOutOfBoundsException when scraped page is empty.
This commit is contained in:
parent
4c17bf10eb
commit
e897787d09
1 changed files with 2 additions and 0 deletions
|
@ -263,6 +263,8 @@ public final class ParserUtils
|
|||
is.mark(PEEK_SIZE);
|
||||
final byte[] firstBytes = new byte[PEEK_SIZE];
|
||||
final int read = is.read(firstBytes);
|
||||
if (read == -1)
|
||||
return "";
|
||||
is.reset();
|
||||
return new String(firstBytes, 0, read).replaceAll("\\p{C}", "");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue