diff --git a/src/main/java/swiss/fihlon/apus/plugin/social/bluesky/DefaultBlueSkyLoader.java b/src/main/java/swiss/fihlon/apus/plugin/social/bluesky/DefaultBlueSkyLoader.java index da75354..6a733b7 100644 --- a/src/main/java/swiss/fihlon/apus/plugin/social/bluesky/DefaultBlueSkyLoader.java +++ b/src/main/java/swiss/fihlon/apus/plugin/social/bluesky/DefaultBlueSkyLoader.java @@ -32,11 +32,7 @@ public JSONArray getPosts(@NotNull final String instance, @NotNull final String try { final var url = String.format(postAPI, instance, hashtag); final var json = DownloadUtil.getString(url); - final var jsonPosts = new JSONObject(json).getJSONArray("posts"); - if (jsonPosts != null) { - return jsonPosts; - } - throw new NullPointerException(String.format("No posts with hashtag '%s' from BlueSky instance '%s'", hashtag, instance)); + return new JSONObject(json).getJSONArray("posts"); } catch (final Exception e) { throw new BlueSkyException(String.format("Unable to load posts with hashtag '%s' from BlueSky instance '%s'", hashtag, instance), e); }