SlamaFR / UGE-Bot

A private Discord bot made in Kotlin.
MIT License
3 stars 1 forks source link

Config initialization #95

Closed SlamaFR closed 2 years ago

SlamaFR commented 2 years ago

So, I was setting up a fresh Docker installation, and ran into an annoying problem. If the data and/or config directories doesn't exist, the bot crashes into a StackOverflowError:

Exception in thread "main" java.lang.StackOverflowError
    at java.base/java.io.UnixFileSystem.normalize(UnixFileSystem.java:76)
    at java.base/java.io.UnixFileSystem.normalize(UnixFileSystem.java:100)
    at java.base/java.io.File.<init>(File.java:280)
    at io.slama.core.BotConfiguration$shusherConfig$2.invoke(config.kt:250)
    at io.slama.core.BotConfiguration$shusherConfig$2.invoke(config.kt:249)
    at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
    at io.slama.core.BotConfiguration.getShusherConfig(config.kt:249)
    at io.slama.core.BotConfiguration.access$getShusherConfig(config.kt:31)
    at io.slama.core.BotConfiguration$Companion.getShusher(config.kt:41)
    at io.slama.core.BotConfiguration$Companion.resetConfig(config.kt:72)
    at io.slama.core.BotConfiguration$shusherConfig$2.invoke(config.kt:252)
    at io.slama.core.BotConfiguration$shusherConfig$2.invoke(config.kt:249)
    at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
    at io.slama.core.BotConfiguration.getShusherConfig(config.kt:249)
    at io.slama.core.BotConfiguration.access$getShusherConfig(config.kt:31)
    at io.slama.core.BotConfiguration$Companion.getShusher(config.kt:41)
    at io.slama.core.BotConfiguration$Companion.resetConfig(config.kt:72)
    at io.slama.core.BotConfiguration$shusherConfig$2.invoke(config.kt:252)
    at io.slama.core.BotConfiguration$shusherConfig$2.invoke(config.kt:249)
    at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
...

Should be easily fixable.

ZwenDo commented 2 years ago

👍

github-actions[bot] commented 2 years ago

Closed by #96.