mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 20:24:05 -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) => {
|
||||
rowData = [];
|
||||
keyColumnOrder.forEach((key) => {
|
||||
if (item.hasOwnProperty(key) && item[key]) {
|
||||
rowData.push(item[key]!.toString());
|
||||
const data = item[key];
|
||||
if (item.hasOwnProperty(key) && data !== null && typeof data !== 'undefined') {
|
||||
rowData.push(data.toString());
|
||||
} else {
|
||||
rowData.push('');
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue