diff --git a/src/main/java/api/longpoll/bots/LongPollBot.java b/src/main/java/api/longpoll/bots/LongPollBot.java index b0416cf8..d4ff5f55 100644 --- a/src/main/java/api/longpoll/bots/LongPollBot.java +++ b/src/main/java/api/longpoll/bots/LongPollBot.java @@ -32,7 +32,7 @@ public abstract class LongPollBot extends VkBot { /** * Latest received event. */ - private int ts; + private Integer ts; /** * Whether infinite loop should be continued. @@ -97,7 +97,9 @@ public void initialize() throws VkApiException { server = longPollServer.get("server").getAsString(); key = longPollServer.get("key").getAsString(); - ts = longPollServer.get("ts").getAsInt(); + if (ts == null) { + ts = longPollServer.get("ts").getAsInt(); + } } /**