aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-07-02 15:14:35 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-07-02 15:14:35 +0200
commit7e29ede74e1da3815fc059fc907abca88878fd39 (patch)
tree94fad5ffe75778981bbf1289bf6139290504b807 /src
parent098c0064f5aafcebf97dbd48057c6437e39f2834 (diff)
downloadskyhanni-7e29ede74e1da3815fc059fc907abca88878fd39.tar.gz
skyhanni-7e29ede74e1da3815fc059fc907abca88878fd39.tar.bz2
skyhanni-7e29ede74e1da3815fc059fc907abca88878fd39.zip
Fixed empty stack trace error
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/command/CopyErrorCommand.kt4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/test/command/CopyErrorCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/command/CopyErrorCommand.kt
index 94716762f..1ae398e4c 100644
--- a/src/main/java/at/hannibal2/skyhanni/test/command/CopyErrorCommand.kt
+++ b/src/main/java/at/hannibal2/skyhanni/test/command/CopyErrorCommand.kt
@@ -41,7 +41,9 @@ object CopyErrorCommand {
Minecraft.getMinecraft().thePlayer ?: throw error
error.printStackTrace()
- val pair = throwable.stackTrace[0].let { it.fileName to it.lineNumber }
+ val pair = if (throwable.stackTrace.isNotEmpty()) {
+ throwable.stackTrace[0].let { it.fileName to it.lineNumber }
+ } else message to 0
if (cache.getIfPresent(pair) != null) return
cache.put(pair, Unit)