diff --git a/src/main/java/swiss/fihlon/apus/plugin/social/bluesky/BlueSkyPlugin.java b/src/main/java/swiss/fihlon/apus/plugin/social/bluesky/BlueSkyPlugin.java index 23eced3..99b7a46 100644 --- a/src/main/java/swiss/fihlon/apus/plugin/social/bluesky/BlueSkyPlugin.java +++ b/src/main/java/swiss/fihlon/apus/plugin/social/bluesky/BlueSkyPlugin.java @@ -100,10 +100,12 @@ private Post createPost(final @NotNull JSONObject post) { final var imageLinks = new ArrayList(); if (post.has("embed")) { final var embed = post.getJSONObject("embed"); - if (embed.getString("$type").equals("app.bsky.embed.images#view")) { + final var type = embed.getString("$type"); + if (type.equals("app.bsky.embed.images#view")) { final var images = embed.getJSONArray("images"); for (var i = 0; i < images.length(); i++) { - imageLinks.add(images.getJSONObject(i).getString("thumb")); + final var image = images.getJSONObject(i); + imageLinks.add(image.getString("thumb")); } } }