Skip to content

Patch for when JsonNode child is null#2

Open
Pluggr wants to merge 1 commit intomendixlabs:masterfrom
Pluggr:patch-1
Open

Patch for when JsonNode child is null#2
Pluggr wants to merge 1 commit intomendixlabs:masterfrom
Pluggr:patch-1

Conversation

@Pluggr
Copy link

@Pluggr Pluggr commented Jun 14, 2022

I ran into this bug running Mendix 9.14. but i think this issue is applicable regardless of Mendix version.

This patch prevents running into NullPointerException when traversable(child) is called while child = null

Here an example of the error it will prevent.


Caused by: java.lang.NullPointerException: null
	at jsontotree.Misc.traversable(Misc.java:96)
	at jsontotree.Misc.traverseObject(Misc.java:61)
	at jsontotree.Misc.traverse(Misc.java:44)
	at jsontotree.Misc.traverseArray(Misc.java:84)
	at jsontotree.Misc.traverse(Misc.java:42)
	at jsontotree.Misc.traverseRootObjects(Misc.java:28)
	at jsontotree.actions.ConvertJSONToRootTree.executeAction(ConvertJSONToRootTree.java:52)

This prevents running into NullPointerException when traversable(child) is called while child = null

Here an example of the error it will prevent.


``` 

Caused by: java.lang.NullPointerException: null
	at jsontotree.Misc.traversable(Misc.java:96)
	at jsontotree.Misc.traverseObject(Misc.java:61)
	at jsontotree.Misc.traverse(Misc.java:44)
	at jsontotree.Misc.traverseArray(Misc.java:84)
	at jsontotree.Misc.traverse(Misc.java:42)
	at jsontotree.Misc.traverseRootObjects(Misc.java:28)
	at jsontotree.actions.ConvertJSONToRootTree.executeAction(ConvertJSONToRootTree.java:52)

```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant