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 Oct 4, 2023
1 parent df32918 commit 146459c
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 146459c

Please sign in to comment.