diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2022-09-15 22:00:14 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2022-09-15 22:00:14 +0200 |
commit | f02297bfffcdaaef5da4e04725b0658c00889cb7 (patch) | |
tree | 2567b404d9541e35d5b44379f4b3fad6c933cbbe | |
parent | 0323a7a12effa810b6c360cdc4ce0e273e578802 (diff) | |
download | skyhanni-f02297bfffcdaaef5da4e04725b0658c00889cb7.tar.gz skyhanni-f02297bfffcdaaef5da4e04725b0658c00889cb7.tar.bz2 skyhanni-f02297bfffcdaaef5da4e04725b0658c00889cb7.zip |
fixed ArrayIndexOutOfBoundsException
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/MinecraftConsoleFilter.kt | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/MinecraftConsoleFilter.kt b/src/main/java/at/hannibal2/skyhanni/utils/MinecraftConsoleFilter.kt index 4ac0a78e8..b922e524c 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/MinecraftConsoleFilter.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/MinecraftConsoleFilter.kt @@ -180,8 +180,12 @@ class MinecraftConsoleFilter(private val loggerConfigName: String) : Filter { val cause = thrown.cause if (cause != null) { debug("throw cause: '$cause'") - element = cause.stackTrace[0] - debug("thrown cause first element: '$element'") + if (cause.stackTrace.isNotEmpty()) { + element = cause.stackTrace[0] + debug("thrown cause first element: '$element'") + } else { + debug("thrown cause has no elements") + } } } } |