Fix uniqueId reading error if blank line is exists

This commit is contained in:
Victor Melnik 2020-10-17 20:54:48 +00:00 committed by GitHub
parent a634aa1902
commit 0288b95f02

View File

@ -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;