handle possible type problems w/ m_firstId in JSON

This commit is contained in:
Andrew Dolgov 2015-07-12 22:54:30 +03:00
parent 0be76abf87
commit 2bee76f0c9
1 changed files with 5 additions and 1 deletions

View File

@ -62,7 +62,11 @@ public class HeadlinesRequest extends ApiRequest {
//Log.d(TAG, "headerID:" + header.get("top_id_changed"));
m_firstIdChanged = header.get("first_id_changed") != null;
m_firstId = header.get("first_id").getAsInt();
try {
m_firstId = header.get("first_id").getAsInt();
} catch (NumberFormatException e) {
m_firstId = 0;
}
Log.d(TAG, "firstID=" + m_firstId + " firstIdChanged=" + m_firstIdChanged);