Simplix-Softworks / SimplixStorage

Library to store data in a better way
Apache License 2.0
138 stars 25 forks source link

Error when using the reload callback #56

Closed leonardo-dgs closed 2 years ago

leonardo-dgs commented 2 years ago

Describe the bug When the reload callback is executed, there is throw an error.

To Reproduce Steps to reproduce the behavior:

  1. With the LightningBuilder set a reload callback and use the FlatFile argument.
  2. When the reload callback is executed, is thrown an Exception

Screenshots LightningValidationException

Desktop (please complete the following information):

Additional context [Server thread/ERROR]: Error occurred while enabling InteractiveBooks v1.5.6 (Is it up to date?) net.leonardo_dgs.interactivebooks.simplixstorage.internal.exceptions.LightningValidationException: FileData mustn't be null at net.leonardo_dgs.interactivebooks.simplixstorage.util.Valid.notNull(Valid.java:36) ~[?:?] at net.leonardo_dgs.interactivebooks.simplixstorage.internal.FlatFile.getFileData(FlatFile.java:341) ~[?:?] at net.leonardo_dgs.interactivebooks.simplixstorage.internal.FlatFile.get(FlatFile.java:142) ~[?:?] at net.leonardo_dgs.interactivebooks.simplixstorage.internal.DataStorage.getOrDefault(DataStorage.java:285) ~[?:?] at net.leonardo_dgs.interactivebooks.simplixstorage.internal.DataStorage.getString(DataStorage.java:113) ~[?:?] at net.leonardo_dgs.interactivebooks.ConfigManager.registerBook(ConfigManager.java:64) ~[?:?] at net.leonardo_dgs.interactivebooks.ConfigManager.lambda$loadBookConfigs$0(ConfigManager.java:55) ~[?:?] at net.leonardo_dgs.interactivebooks.simplixstorage.internal.FlatFile.forceReload(FlatFile.java:291) ~[?:?] at net.leonardo_dgs.interactivebooks.simplixstorage.Yaml.<init>(Yaml.java:101) ~[?:?] at net.leonardo_dgs.interactivebooks.simplixstorage.Config.<init>(Config.java:53) ~[?:?] at net.leonardo_dgs.interactivebooks.simplixstorage.LightningBuilder.createConfig(LightningBuilder.java:128) ~[?:?] at net.leonardo_dgs.interactivebooks.ConfigManager.loadBookConfigs(ConfigManager.java:57) ~[?:?] at net.leonardo_dgs.interactivebooks.ConfigManager.loadAll(ConfigManager.java:30) ~[?:?] at net.leonardo_dgs.interactivebooks.InteractiveBooks.onEnable(InteractiveBooks.java:35) ~[?:?] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[spigot-1.17.1.jar:3242-Spigot-6c1c1b2-d3cc412] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:342) ~[spigot-1.17.1.jar:3242-Spigot-6c1c1b2-d3cc412] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:480) ~[spigot-1.17.1.jar:3242-Spigot-6c1c1b2-d3cc412] at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugin(CraftServer.java:514) ~[spigot-1.17.1.jar:3242-Spigot-6c1c1b2-d3cc412] at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugins(CraftServer.java:428) ~[spigot-1.17.1.jar:3242-Spigot-6c1c1b2-d3cc412] at net.minecraft.server.MinecraftServer.loadWorld(MinecraftServer.java:619) ~[spigot-1.17.1.jar:3242-Spigot-6c1c1b2-d3cc412] at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:266) ~[spigot-1.17.1.jar:3242-Spigot-6c1c1b2-d3cc412] at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1010) ~[spigot-1.17.1.jar:3242-Spigot-6c1c1b2-d3cc412] at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:305) ~[spigot-1.17.1.jar:3242-Spigot-6c1c1b2-d3cc412] at java.lang.Thread.run(Thread.java:833) [?:?]

KotlinFactory commented 2 years ago

Hey, is this fixed with the latest version?

Regards, Leonhard

KotlinFactory commented 2 years ago

Should be resolved with the latest commit.