fix(Set Node): Null should not throw an error (#7416)
Github issue / Community forum post (link here to close automatically):
This commit is contained in:
@@ -21,7 +21,7 @@ const versionDescription: INodeTypeDescription = {
|
||||
name: 'set',
|
||||
icon: 'fa:pen',
|
||||
group: ['input'],
|
||||
version: [3, 3.1],
|
||||
version: [3, 3.1, 3.2],
|
||||
description: 'Change the structure of your items',
|
||||
subtitle: '={{$parameter["mode"]}}',
|
||||
defaults: {
|
||||
|
||||
@@ -163,6 +163,11 @@ export const validateEntry = (
|
||||
) => {
|
||||
let entryValue = entry[entry.type];
|
||||
const name = entry.name;
|
||||
|
||||
if (nodeVersion && nodeVersion >= 3.2 && (entryValue === undefined || entryValue === null)) {
|
||||
return { name, value: null };
|
||||
}
|
||||
|
||||
const entryType = entry.type.replace('Value', '') as FieldType;
|
||||
|
||||
const description = `To fix the error try to change the type for the field "${name}" or activate the option “Ignore Type Conversion Errors” to apply a less strict type validation`;
|
||||
|
||||
@@ -182,7 +182,12 @@ export async function execute(
|
||||
const newData: IDataObject = {};
|
||||
|
||||
for (const entry of fields) {
|
||||
if (entry.type === 'objectValue' && rawFieldsData[entry.name] !== undefined) {
|
||||
if (
|
||||
entry.type === 'objectValue' &&
|
||||
rawFieldsData[entry.name] !== undefined &&
|
||||
entry.objectValue !== undefined &&
|
||||
entry.objectValue !== null
|
||||
) {
|
||||
entry.objectValue = parseJsonParameter(
|
||||
resolveRawData.call(this, rawFieldsData[entry.name] as string, i),
|
||||
node,
|
||||
|
||||
Reference in New Issue
Block a user