Skip to content

Commit

Permalink
🔥 remove unreachable code #23
Browse files Browse the repository at this point in the history
  • Loading branch information
McPringle committed Nov 30, 2024
1 parent add8700 commit b59b8c2
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit b59b8c2

Please sign in to comment.