Skip to content

Commit b3fa840

Browse files
Fixed bug where the url parsing just crashes and the suggestion message will be not created.
1 parent 9364c6c commit b3fa840

File tree

1 file changed

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

1 file changed

+2
-3
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,10 @@ 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
}
208-
} catch (URISyntaxException e) {
209-
e.printStackTrace();
208+
} catch (URISyntaxException ignored) {
210209
}
211210
}
212211
}

0 commit comments

Comments
 (0)