Skip to content

Commit

Permalink
'#1898: avoid possible AIOOBE in commit 902326d
Browse files Browse the repository at this point in the history
  • Loading branch information
lfcnassif committed Sep 28, 2023
1 parent c5fae0d commit d71c6c8
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ public void parse(InputStream indexFile, ContentHandler handler, Metadata metada

// Checking attachments image
for (DiscordAttachment att : dr.getAttachments()) {
if (ce2.getRequestURL().contains(att.getUrl().split("https://cdn.discordapp.com/attachments/")[1])) {
String[] parts = att.getUrl().split("https://cdn.discordapp.com/attachments/");
if (parts.length > 1 && ce2.getRequestURL().contains(parts[1])) {
for (IItemReader ib : externalFiles) {
if (ib.getName() != null && ib.getName().equals(ce2.getName())) {
att.setMediaHash(ib.getHash());
Expand Down

0 comments on commit d71c6c8

Please sign in to comment.