Skip to content

Commit 9085b7b

Browse files
Fixed bug where the url parsing just crashes and the suggestion message will be not created. (#287)
Fixed bug where the url parsing just crashes and the suggestion message will be not created.
2 parents 9364c6c + e1d6906 commit 9085b7b

File tree

1 file changed

+2
-2
lines changed
  • src/main/java/net/javadiscord/javabot/systems/moderation

1 file changed

+2
-2
lines changed

src/main/java/net/javadiscord/javabot/systems/moderation/AutoMod.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,11 @@ public boolean hasSuspiciousLink(Message message) {
202202
String url = urlMatcher.group(0).trim();
203203
try {
204204
URI uri = new URI(url);
205-
if (spamUrls.contains(uri.getHost())) {
205+
if (uri.getHost() != null && spamUrls.contains(uri.getHost())) {
206206
return true;
207207
}
208208
} catch (URISyntaxException e) {
209-
e.printStackTrace();
209+
log.error("Error while parsing URL: " + url, e);
210210
}
211211
}
212212
}

0 commit comments

Comments
 (0)