Targren / BetterRecords

MIT License
0 stars 0 forks source link

Adding URL to remoteLibraries.txt causes crash on startup #4

Open Targren opened 2 years ago

Targren commented 2 years ago

Version Info

Forge version:
Mod version: Initial Fork

Description

See title

Steps to reproduce:

  1. Add a url to remoteLibraries.txt
  2. Start client

What I expect to happen:

Not crash.

What actually happens:

net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Better Records (betterrecords) Caused by: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $ at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:224) at com.google.gson.Gson.fromJson(Gson.java:887) at com.google.gson.Gson.fromJson(Gson.java:852) at com.google.gson.Gson.fromJson(Gson.java:801) at com.google.gson.Gson.fromJson(Gson.java:773) at tech.feldman.betterrecords.library.LibraryContent$Companion.fromJson(LibraryContent.kt:50) at tech.feldman.betterrecords.library.RemoteLibrary.(Library.kt:80) at tech.feldman.betterrecords.library.Libraries.init(Libraries.kt:118) at tech.feldman.betterrecords.CommonProxy.init(CommonProxy.kt:43) at tech.feldman.betterrecords.client.ClientProxy.init(ClientProxy.kt:48) at tech.feldman.betterrecords.BetterRecords.init(BetterRecords.kt:53) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ...

Targren commented 2 years ago

Problem is sloppy library handling. Doesn't verify file even exists before trying to process it as JSON (404 error also caused full fatal crash).