Skip to content

Commit

Permalink
Prevent bad deserialize updates [issue #1]
Browse files Browse the repository at this point in the history
  • Loading branch information
Cadiducho committed Feb 18, 2016
1 parent d40bfa1 commit 9e0c677
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/com/cadiducho/minegram/TelegramBot.java
Original file line number Diff line number Diff line change
Expand Up @@ -458,9 +458,9 @@ public List<Update> getUpdates(Integer offset, Integer limit, Integer timeout) t
par.putAll(safe("timeout", timeout));

final String resultBody = handleRequest(Unirest.get(apiUrl + "getUpdates").queryString(par));
System.out.println(resultBody);
try {
return mapper.readValue(resultBody, new TypeReference<List<Update>>(){});
return mapper.readValue(resultBody,
mapper.getTypeFactory().constructCollectionType(List.class, Update.class));
} catch (IOException e) {
throw new TelegramException("Could not deserialize response! (getUpdates)", e);
}
Expand Down

0 comments on commit 9e0c677

Please sign in to comment.