mirror of
https://github.com/annimon-tutorials/Similar-Images-Bot.git
synced 2024-09-20 03:34:19 +03:00
Fix uniqueId reading error if blank line is exists
This commit is contained in:
parent
a634aa1902
commit
0288b95f02
@ -97,7 +97,8 @@ public abstract class BaseBotHandler {
|
||||
|
||||
private int readLastUpdateId() {
|
||||
try {
|
||||
return Integer.parseInt(Files.readString(uniqueIdPath));
|
||||
final String content = Files.readString(uniqueIdPath);
|
||||
return Integer.parseInt(content.trim());
|
||||
} catch (IOException ioe) {
|
||||
LOGGER.error("readLastUpdateId", ioe);
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user