narrowtux / SmartModInserter

Manages mods for factorio
GNU Lesser General Public License v3.0
38 stars 12 forks source link

Application crashes if mod metadata is not valid json #17

Open Buri opened 7 years ago

Buri commented 7 years ago
com.google.gson.JsonSyntaxException: duplicate key: factorio_version
        at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.read(MapTypeAdapterFactory.java:190)
        at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.read(MapTypeAdapterFactory.java:145)
        at com.google.gson.Gson.fromJson(Gson.java:803)
        at com.google.gson.Gson.fromJson(Gson.java:741)
        at com.narrowtux.fmm.ModpackDetectorVisitor.visitFile(ModpackDetectorVisitor.java:76)
        at com.narrowtux.fmm.ModpackDetectorVisitor.visitFile(ModpackDetectorVisitor.java:21)
        at java.nio.file.Files.walkFileTree(Unknown Source)
        at java.nio.file.Files.walkFileTree(Unknown Source)
        at com.narrowtux.fmm.Datastore.scanDirectory(Datastore.java:71)
        at com.narrowtux.fmm.Main.continueStartup(Main.java:85)
        at com.narrowtux.fmm.Main.start(Main.java:72)
        at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(LauncherImpl.java:863)
        at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326)
        at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
        at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
        at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
        at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
        at java.lang.Thread.run(Unknown Source)
narrowtux commented 7 years ago

I'm just guessing here but it seems like a json file that is read has a key duplicated which is invalid according to the json spec. I can look deeper into which json file that would be if you can't find it on your own. Jakub Buriánek notifications@github.com schrieb am Do. 2. März 2017 um 08:54:

com.google.gson.JsonSyntaxException: duplicate key: factorio_version at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.read(MapTypeAdapterFactory.java:190) at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.read(MapTypeAdapterFactory.java:145) at com.google.gson.Gson.fromJson(Gson.java:803) at com.google.gson.Gson.fromJson(Gson.java:741) at com.narrowtux.fmm.ModpackDetectorVisitor.visitFile(ModpackDetectorVisitor.java:76) at com.narrowtux.fmm.ModpackDetectorVisitor.visitFile(ModpackDetectorVisitor.java:21) at java.nio.file.Files.walkFileTree(Unknown Source) at java.nio.file.Files.walkFileTree(Unknown Source) at com.narrowtux.fmm.Datastore.scanDirectory(Datastore.java:71) at com.narrowtux.fmm.Main.continueStartup(Main.java:85) at com.narrowtux.fmm.Main.start(Main.java:72) at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(LauncherImpl.java:863) at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326) at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295) at java.security.AccessController.doPrivileged(Native Method) at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294) at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95) at com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191) at java.lang.Thread.run(Unknown Source)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/narrowtux/SmartModInserter/issues/17, or mute the thread https://github.com/notifications/unsubscribe-auth/AAlpVweAzJiOXvOsYXmdFonSha6sOrcYks5rhnWtgaJpZM4MQqOc .

Buri commented 7 years ago

Yeah, i know it was Tombstone mod, but either way it should not crash whole app, at least not without any message to the user