mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34:06 -08:00
🐛 Fix Google Sheet to handle 0 correctly (#1937)
* 🐛 Fix Google Sheet to handle 0 correctly `if (condition) { statement }` will not be executed if the `condition` is `0` (number) so that appending 0 to Google Sheets results in an empty cell. Checking if the value is `null` or `undefined` is enough to guarantee that `toString` is callable. * 🐛 Add semicolon
This commit is contained in:
parent
05921de99a
commit
6d8ea4bff5
|
@ -486,8 +486,9 @@ export class GoogleSheet {
|
||||||
inputData.forEach((item) => {
|
inputData.forEach((item) => {
|
||||||
rowData = [];
|
rowData = [];
|
||||||
keyColumnOrder.forEach((key) => {
|
keyColumnOrder.forEach((key) => {
|
||||||
if (item.hasOwnProperty(key) && item[key]) {
|
const data = item[key];
|
||||||
rowData.push(item[key]!.toString());
|
if (item.hasOwnProperty(key) && data !== null && typeof data !== 'undefined') {
|
||||||
|
rowData.push(data.toString());
|
||||||
} else {
|
} else {
|
||||||
rowData.push('');
|
rowData.push('');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue