You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When there is a edge case in the input variable payload such as array of null elements, the recursive method convertLosslessNumbersToNumberOrThrow underneath the createWorker throws cannot read properties of null error.
SDK Component
Zeebe gRPC client
Expected Behavior
The null should be ignored and the JSON string should be serialized successfully
Current Behavior
The convertLosslessNumbersToNumberOrThrow method in LosslessJsonParser.ts throws out exception on the 1st line debug(Parsing LosslessNumbers to numbers for ${obj.constructor.name}) when the obj is null.
Error: Cannot read properties of null (reading 'constructor')
Possible Solution
Add the null check in the convertLosslessNumbersToNumberOrThrow method in LosslessJsonParser.ts.
Add safe navigation operation on line 223: obj?.constructor?.name
Add a null check before 224: if (!obj) return obj;
The new added unit test will be failed with below error:
An unsafe number value was received for "abc" and no Dto mapping was specified.
Cannot read properties of null (reading 'constructor')
248 | } catch (e) {
249 | const message = (e as Error).message
> 250 | throw new Error(
| ^
251 | `An unsafe number value was received for "${currentKey}" and no Dto mapping was specified.\n` +
252 | message
253 | )
Context (Environment)
The error will stop Zeebe gRPC client from polling activate tasks.
The text was updated successfully, but these errors were encountered:
When there is a edge case in the input variable payload such as array of null elements, the recursive method
convertLosslessNumbersToNumberOrThrow
underneath thecreateWorker
throwscannot read properties of null
error.SDK Component
Zeebe gRPC client
Expected Behavior
The null should be ignored and the JSON string should be serialized successfully
Current Behavior
The
convertLosslessNumbersToNumberOrThrow
method inLosslessJsonParser.ts
throws out exception on the 1st linedebug(
Parsing LosslessNumbers to numbers for ${obj.constructor.name})
when theobj
is null.Error:
Cannot read properties of null (reading 'constructor')
Possible Solution
Add the null check in the
convertLosslessNumbersToNumberOrThrow
method inLosslessJsonParser.ts
.Add safe navigation operation on line 223:
obj?.constructor?.name
Add a null check before 224:
if (!obj) return obj;
Steps to Reproduce
Context (Environment)
The error will stop Zeebe gRPC client from polling activate tasks.
The text was updated successfully, but these errors were encountered: