Describe the bug
DishJSON line 20 uses this.value as tertiary conditional check before either stringifying the JSON or initialising a new ArrayBuffer. This means that valid JSON values of null and false are replaced with ArrayBuffer if they are the sole element.
To Reproduce
Steps to reproduce the behaviour or a link to the recipe / input used to cause the bug:
Create a recipe with From Hex and From MessagePack and enter the following inputs:
- C0 (null)
- C2 (false)
- C3 (true)
Expected behaviour
- C0 should display null in the output but displays nothing
- C2 should display false in the output but displays nothing
- C3 should and does correctly display true
Screenshots
N/A
Desktop (if relevant, please complete the following information):
N/A - applies to current head of master
Additional context
The fix should change the tertiary conditional check in DishJSON on line JSON from:
this.value = this.value ? Utils.strToArrayBuffer(JSON.stringify(this.value, null, 4)) : new ArrayBuffer;
to:
this.value = this.value !== undefined ? Utils.strToArrayBuffer(JSON.stringify(this.value, null, 4)) : new ArrayBuffer;
Describe the bug
DishJSON line 20 uses this.value as tertiary conditional check before either stringifying the JSON or initialising a new ArrayBuffer. This means that valid JSON values of null and false are replaced with ArrayBuffer if they are the sole element.
To Reproduce
Steps to reproduce the behaviour or a link to the recipe / input used to cause the bug:
Create a recipe with From Hex and From MessagePack and enter the following inputs:
Expected behaviour
Screenshots
N/A
Desktop (if relevant, please complete the following information):
N/A - applies to current head of master
Additional context
The fix should change the tertiary conditional check in DishJSON on line JSON from:
this.value = this.value ? Utils.strToArrayBuffer(JSON.stringify(this.value, null, 4)) : new ArrayBuffer;to:
this.value = this.value !== undefined ? Utils.strToArrayBuffer(JSON.stringify(this.value, null, 4)) : new ArrayBuffer;