Skip to content

NullPointerException when using setJsonVariable with null value #535

Description

@jaboehri

Description

In API v2, using Variables#setJsonVariable using a null value e.g. setJsonVariable("foo", null) throws a NullPointerException because VariablesImpl uses getClass() on the serialized object which breaks if the object is null.

Effected DSF Version

  • 2.1.0
  • 2.0.1
  • 2.0.2
  • 2.0.0

To Reproduce

Call setJsonVariable in a process plugin with a variable name of your choice and a null value.

Expected Behavior

Set the variable to null, don't throw a NullPointerException.

Logs

BPE:

WARN pool-6-thread-1 - AbstractErrorHandler.handleException(68) | Process dsfdev_ping:4:64a6671d-791f-11f1-af47-76c45e579722 has fatal error in step SavePongServiceTask:1bbb9b12-79e4-11f1-8645-ba4df22d5e8b for service task https://ttp/fhir/Task/e2f34a84-479a-4a0d-93e7-19ad57339158, reason: java.lang.NullPointerException - Cannot invoke "Object.getClass()" because "json" is null

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingready for releaseIssue is fixed and merged into develop, ready for next release

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions