Skip to content

Commit

Permalink
Avoid Illegal argument exceptions in log uploading
Browse files Browse the repository at this point in the history
  • Loading branch information
NoComment1105 committed Mar 27, 2023
1 parent d79fc0c commit e7d0fc8
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,13 @@ class LogUploading : Extension() {
val thread =
event.getGuildOrNull()?.getChannelOfOrNull<TextChannelThread>(it.threadId) ?: return@forEach
if (thread.parentId == autoThreadingConfig?.channelId) {
uploadChannel =
event.getGuildOrNull()?.getChannelOfOrNull<GuildMessageChannel>(it.threadId)
?: return@forEach
try {
uploadChannel =
event.getGuildOrNull()?.getChannelOfOrNull<GuildMessageChannel>(it.threadId)
?: return@forEach
} catch (_: IllegalArgumentException) {
return@forEach
}
return@forEach
}
}
Expand Down

0 comments on commit e7d0fc8

Please sign in to comment.