-
-
Notifications
You must be signed in to change notification settings - Fork 4
Closed
Description
Issue type:
- 🐛 Bug
Short description:
When returning a JSON object that has a field set to null, Gson cannot handle this field and throws an error. In a display panel, this usually results in a crash, but is sometimes error-handled as the display panel getting deleted.
Steps to reproduce the problem:
- Assemble a display panel, variable store, scripting drive and scripting terminal.
- Create a script with the following contents:
function bad_object() {
let bad_obj = {};
bad_obj["foo"] = null;
return bad_obj;
}- Create an operator variable card with this script.
- Apply0 the generated operator
- Put the new variable card into a display panel
- Game crash or display panel vanishes.
Expected behaviour:
I believe fields assigned null should be filtered out and ignored when converting a json object into nbt, though the exact behaviour of this may need discussion (null can be useful for communication between scripts, but doesn't really exist in NBT)
Versions:
- This mod: IntegratedScripting 1.0.7
- Minecraft: 1.21.1
- Mod loader version: NeoForge 21.1.89
Log file:
https://gist.github.com/FloralSoda/a4e65e108424e83ae3d8ec993e138e73
Metadata
Metadata
Assignees
Type
Projects
Status
Done