mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
⚡ Make WriteBinaryFile-Node error when data is missing
This commit is contained in:
parent
99c13249db
commit
f2236ba38c
|
@ -60,11 +60,11 @@ export class WriteBinaryFile implements INodeType {
|
||||||
const fileName = this.getNodeParameter('fileName') as string;
|
const fileName = this.getNodeParameter('fileName') as string;
|
||||||
|
|
||||||
if (item.binary === undefined) {
|
if (item.binary === undefined) {
|
||||||
return item;
|
throw new Error('No binary data set. So file can not be written!');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.binary[dataPropertyName] === undefined) {
|
if (item.binary[dataPropertyName] === undefined) {
|
||||||
return item;
|
throw new Error(`The binary property "${dataPropertyName}" does not exist. So no file can be written!`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write the file to disk
|
// Write the file to disk
|
||||||
|
|
Loading…
Reference in a new issue