1
1
mirror of https://github.com/n8n-io/n8n.git synced 2024-09-20 01:19:07 +03:00

🐛 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');
}
const newItem: INodeExecutionData = {
json: item.json,
binary: {},
};
if (operation === 'information') {
// Just return the information
const imageData = await new Promise<IDataObject>((resolve, reject) => {
@ -1196,8 +1201,7 @@ export class EditImage implements INodeType {
});
});
item.json = imageData;
returnData.push(item);
newItem.json = imageData;
}
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) {
// Create a shallow copy of the binary data so that the old
// data references which do not get changed still stay behind