From bd23e009a96da25713f0e65518b03a455ae05483 Mon Sep 17 00:00:00 2001 From: nuclearfog Date: Thu, 9 Nov 2023 23:05:56 +0100 Subject: [PATCH] bugfix --- .../org/nuclearfog/twidda/backend/api/mastodon/Mastodon.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/nuclearfog/twidda/backend/api/mastodon/Mastodon.java b/app/src/main/java/org/nuclearfog/twidda/backend/api/mastodon/Mastodon.java index 136c9200..503546d2 100644 --- a/app/src/main/java/org/nuclearfog/twidda/backend/api/mastodon/Mastodon.java +++ b/app/src/main/java/org/nuclearfog/twidda/backend/api/mastodon/Mastodon.java @@ -643,7 +643,8 @@ public class Mastodon implements Connection { public Statuses getStatusReplies(long id, long minId, long maxId) throws MastodonException { Statuses statusThreads = getStatuses(ENDPOINT_STATUS + id + "/context", new ArrayList<>(0), minId, maxId); Statuses result = new Statuses(); - for (int i = 0; i < settings.getListSize(); i++) + int limit = Math.min(statusThreads.size(), settings.getListSize()); + for (int i = 0; i < limit; i++) result.add(statusThreads.get(i)); result.setNextCursor(Statuses.NO_ID); return result;