ebullient / ttrpg-convert-cli

Utility to convert JSON data (for content you own) from 5etools or pf2etools into Obsidian-friendly Markdown.
https://www.ebullient.dev/projects/ttrpg-convert-cli/
Apache License 2.0
197 stars 39 forks source link

🐛 Crashes with a NPE when creating the index #196

Closed scottmc42 closed 1 year ago

scottmc42 commented 1 year ago

A clear and concise summary of what the bug is. Include the name/source of the badly rendered note, if applicable. Running the first command to get started ttrpg-convert --index -o dm 5etools-mirror-1.github.io/data

🔸 Source TDCSR is unknown
🛑 An error occurred: Cannot invoke "com.fasterxml.jackson.databind.node.ObjectNode.set(String, com.fasterxml.jackson.databind.JsonNode)" because "targetNode" is null.

Running with --debug

An error occurred: Cannot invoke "com.fasterxml.jackson.databind.node.ObjectNode.set(String, com.fasterxml.jackson.databind.JsonNode)" because "targetNode" is null.

Run with --debug for details.
java.lang.NullPointerException: Cannot invoke "com.fasterxml.jackson.databind.node.ObjectNode.set(String, com.fasterxml.jackson.databind.JsonNode)" because "targetNode" is null
    at dev.ebullient.convert.tools.dnd5e.JsonSourceCopier.lambda$mergeFields$8(JsonSourceCopier.java:357)
    at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
    at dev.ebullient.convert.tools.dnd5e.JsonSourceCopier.mergeFields(JsonSourceCopier.java:357)
    at dev.ebullient.convert.tools.dnd5e.JsonSourceCopier.mergeNodes(JsonSourceCopier.java:193)
    at dev.ebullient.convert.tools.dnd5e.JsonSourceCopier.cloneOrCopy(JsonSourceCopier.java:106)
    at dev.ebullient.convert.tools.dnd5e.JsonSourceCopier.copyAndMergeRace(JsonSourceCopier.java:78)
    at dev.ebullient.convert.tools.dnd5e.JsonSourceCopier.handleCopy(JsonSourceCopier.java:47)
    at dev.ebullient.convert.tools.dnd5e.Tools5eIndex.prepare(Tools5eIndex.java:347)
    at dev.ebullient.convert.RpgDataConvertCli.call(RpgDataConvertCli.java:229)
    at dev.ebullient.convert.RpgDataConvertCli.call(RpgDataConvertCli.java:39)
    at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
    at picocli.CommandLine.access$1500(CommandLine.java:148)
    at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
    at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
    at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
    at dev.ebullient.convert.RpgDataConvertCli.executionStrategy(RpgDataConvertCli.java:264)
    at picocli.CommandLine.execute(CommandLine.java:2170)
    at dev.ebullient.convert.RpgDataConvertCli.run(RpgDataConvertCli.java:276)
    at dev.ebullient.convert.RpgDataConvertCli_ClientProxy.run(Unknown Source)
    at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:132)
    at io.quarkus.runtime.Quarkus.run(Quarkus.java:71)
    at io.quarkus.runtime.Quarkus.run(Quarkus.java:44)
    at io.quarkus.runner.GeneratedMain.main(Unknown Source)

A clear and concise description of what you expected to happen. A text snippet is helpful. Don't crash

A clear and concise description of what actually happened. A text snippet is helpful. Null Pointer Exception

Configuration

Sources:

ebullient commented 1 year ago

Yes. That should be fixed with this: f32faf425abd7b819665d6b353980caa42ed4e24 (fixed last night, as someone else brought it to my attention)

If you can try the latest snapshot?

(Also, thank you for opening issue. Much appreciated!)

ebullient commented 1 year ago

Fresh Tools5e build (downloading new data) is here: https://github.com/ebullient/ttrpg-convert-cli/actions/runs/5976713874. I anticipate that will be clean.

ebullient commented 1 year ago

we're good! (will release soon)