🐛 Fix bug that two items get returned

This commit is contained in:
Jan Oberhauser 2022-01-07 18:38:35 +01:00
parent 214dd5061e
commit 9d42a07a0b

View file

@ -1184,6 +1184,11 @@ export class EditImage implements INodeType {
gmInstance = gmInstance.background('transparent'); gmInstance = gmInstance.background('transparent');
} }
const newItem: INodeExecutionData = {
json: item.json,
binary: {},
};
if (operation === 'information') { if (operation === 'information') {
// Just return the information // Just return the information
const imageData = await new Promise<IDataObject>((resolve, reject) => { const imageData = await new Promise<IDataObject>((resolve, reject) => {
@ -1196,8 +1201,7 @@ export class EditImage implements INodeType {
}); });
}); });
item.json = imageData; newItem.json = imageData;
returnData.push(item);
} }
for (let i = 0; i < operations.length; i++) { for (let i = 0; i < operations.length; i++) {
@ -1308,11 +1312,6 @@ export class EditImage implements INodeType {
} }
} }
const newItem: INodeExecutionData = {
json: item.json,
binary: {},
};
if (item.binary !== undefined) { if (item.binary !== undefined) {
// Create a shallow copy of the binary data so that the old // Create a shallow copy of the binary data so that the old
// data references which do not get changed still stay behind // data references which do not get changed still stay behind