Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,13 @@ public long getLikeCount() throws ParsingException {
return 0;
}

return Integer.parseInt(Utils.removeNonDigitCharacters(likesString));
final String digitsOnly = Utils.removeNonDigitCharacters(likesString);

if (digitsOnly == null || digitsOnly.isEmpty()) {
throw new ParsingException("Could not extract digits from \"" + likesString + "\"");
}

return Integer.parseInt(digitsOnly);
} catch (final NumberFormatException nfe) {
throw new ParsingException("Could not parse \"" + likesString + "\" as an Integer",
nfe);
Expand Down