From 056604d9bb1c7b9414c5d4863cc45dd255396b70 Mon Sep 17 00:00:00 2001 From: Ammar Githam Date: Mon, 21 Sep 2020 03:48:45 +0900 Subject: [PATCH] Handle newest_cursor and oldest_cursor not sent in response --- .../main/java/awais/instagrabber/utils/ResponseBodyUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/awais/instagrabber/utils/ResponseBodyUtils.java b/app/src/main/java/awais/instagrabber/utils/ResponseBodyUtils.java index a5610b22..658177d3 100644 --- a/app/src/main/java/awais/instagrabber/utils/ResponseBodyUtils.java +++ b/app/src/main/java/awais/instagrabber/utils/ResponseBodyUtils.java @@ -232,8 +232,8 @@ public final class ResponseBodyUtils { final String threadV2Id = data.getString("thread_v2_id"); final String threadTitle = data.getString("thread_title"); - final String threadNewestCursor = data.getString("newest_cursor"); - final String threadOldestCursor = data.getString("oldest_cursor"); + final String threadNewestCursor = data.optString("newest_cursor"); + final String threadOldestCursor = data.optString("oldest_cursor"); final String threadNextCursor = data.has("next_cursor") ? data.getString("next_cursor") : null; final String threadPrevCursor = data.has("prev_cursor") ? data.getString("prev_cursor") : null;