From f02297bfffcdaaef5da4e04725b0658c00889cb7 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Thu, 15 Sep 2022 22:00:14 +0200 Subject: fixed ArrayIndexOutOfBoundsException --- .../java/at/hannibal2/skyhanni/utils/MinecraftConsoleFilter.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/main/java/at') 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") + } } } } -- cgit