Auto Clicker

Auto Clicker

361k Downloads

Changing the config text to a non json-conforming text (which can happen by accident) crashes the mod.

AdyTech99 opened this issue ยท 0 comments

commented

Describe the bug
Changing the config text, by manually opening the config, to a non json-conforming text (which can happen by accident) crashes the mod.

To Reproduce
Steps to reproduce the behavior:

  1. Open auto-clicker-fabric.json config file
  2. Deliberately make a mistake in the file, example: remove a quote (") or delete a colon (:)

Expected behavior
The mod should detect the error, and regenerate the config.

What actually happens
The mod crashes.

Crash log
net.fabricmc.loader.impl.FormattedException: com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Expected ':' at line 1 column 130 path $.rightCli{
at net.fabricmc.loader.impl.FormattedException.ofLocalized(FormattedException.java:63) ~[fabric-loader-0.15.11.jar:?]
at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:472) ~[fabric-loader-0.15.11.jar:?]
at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74) [fabric-loader-0.15.11.jar:?]
at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23) [fabric-loader-0.15.11.jar:?]
at net.fabricmc.devlaunchinjector.Main.main(Main.java:86) [dev-launch-injector-0.2.1+build.8.jar:?]
Caused by: com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Expected ':' at line 1 column 130 path $.rightCli{
at com.google.gson.Gson.fromJson(Gson.java:1241) ~[gson-2.10.1.jar:?]
at com.google.gson.Gson.fromJson(Gson.java:1137) ~[gson-2.10.1.jar:?]
at com.google.gson.Gson.fromJson(Gson.java:1075) ~[gson-2.10.1.jar:?]
at pro.mikey.autoclicker.AutoClicker.clientReady(AutoClicker.java:90) ~[main/:?]
at net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientLifecycleEvents.lambda$static$0(ClientLifecycleEvents.java:35) ~[fabric-lifecycle-events-v1-2.3.9+98a7dbbb90.jar:?]
at net.minecraft.client.MinecraftClient.handler$zif000$fabric-lifecycle-events-v1$onStart(MinecraftClient.java:4375) ~[minecraft-merged-4eb0fe4bb6-1.21-net.fabricmc.yarn.1_21.1.21+build.1-v2.jar:?]
at net.minecraft.client.MinecraftClient.run(MinecraftClient.java:819) ~[minecraft-merged-4eb0fe4bb6-1.21-net.fabricmc.yarn.1_21.1.21+build.1-v2.jar:?]
at net.minecraft.client.main.Main.main(Main.java:224) ~[minecraft-merged-4eb0fe4bb6-1.21-net.fabricmc.yarn.1_21.1.21+build.1-v2.jar:?]
at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:470) ~[fabric-loader-0.15.11.jar:?]
... 3 more
Caused by: com.google.gson.stream.MalformedJsonException: Expected ':' at line 1 column 130 path $.rightCli{
at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1659) ~[gson-2.10.1.jar:?]
at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:539) ~[gson-2.10.1.jar:?]
at com.google.gson.stream.JsonReader.skipValue(JsonReader.java:1256) ~[gson-2.10.1.jar:?]
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:391) ~[gson-2.10.1.jar:?]
at com.google.gson.Gson.fromJson(Gson.java:1227) ~[gson-2.10.1.jar:?]
at com.google.gson.Gson.fromJson(Gson.java:1137) ~[gson-2.10.1.jar:?]
at com.google.gson.Gson.fromJson(Gson.java:1075) ~[gson-2.10.1.jar:?]
at pro.mikey.autoclicker.AutoClicker.clientReady(AutoClicker.java:90) ~[main/:?]
at net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientLifecycleEvents.lambda$static$0(ClientLifecycleEvents.java:35) ~[fabric-lifecycle-events-v1-2.3.9+98a7dbbb90.jar:?]
at net.minecraft.client.MinecraftClient.handler$zif000$fabric-lifecycle-events-v1$onStart(MinecraftClient.java:4375) ~[minecraft-merged-4eb0fe4bb6-1.21-net.fabricmc.yarn.1_21.1.21+build.1-v2.jar:?]
at net.minecraft.client.MinecraftClient.run(MinecraftClient.java:819) ~[minecraft-merged-4eb0fe4bb6-1.21-net.fabricmc.yarn.1_21.1.21+build.1-v2.jar:?]
at net.minecraft.client.main.Main.main(Main.java:224) ~[minecraft-merged-4eb0fe4bb6-1.21-net.fabricmc.yarn.1_21.1.21+build.1-v2.jar:?]
at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:470) ~[fabric-loader-0.15.11.jar:?]
... 3 more

Process finished with exit code 1

Minecraft Enviorment

  • Minecraft Version: [1.21]
  • XRay Mod Version: [21.0.1]

Additional context
None