Skip to content

Commit

Permalink
More explicit error
Browse files Browse the repository at this point in the history
  • Loading branch information
RobbWatershed committed Sep 9, 2023
1 parent 2f0a42a commit 8aed44d
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,11 @@ private String getJsPagesScript(@NonNull String galleryInfo) {
private void updateContentInfo(@NonNull Content content, @NonNull String galleryInfoStr) throws Exception {
int firstBrace = galleryInfoStr.indexOf("{");
int lastBrace = galleryInfoStr.lastIndexOf("}");
String galleryJson = galleryInfoStr.substring(firstBrace, lastBrace + 1);
HitomiGalleryInfo galleryInfo = JsonHelper.jsonToObject(galleryJson, HitomiGalleryInfo.class);
galleryInfo.updateContent(content);
if (firstBrace > -1 && lastBrace > -1) {
String galleryJson = galleryInfoStr.substring(firstBrace, lastBrace + 1);
HitomiGalleryInfo galleryInfo = JsonHelper.jsonToObject(galleryJson, HitomiGalleryInfo.class);
galleryInfo.updateContent(content);
} else throw new EmptyResultException("Couldn't find gallery information");
}

@Override
Expand Down

0 comments on commit 8aed44d

Please sign in to comment.