Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Commit ca3f0a4

Browse files
committed
unmarshall imprved
1 parent d6b7803 commit ca3f0a4

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/parsers/handlers/unmarshall/UnmarshallColumnsHandler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class UnmarshallColumnsHandler extends AbstractDiskHandler {
2222
.filter(key => typeof column[key] !== 'object')
2323
.forEach(key => {
2424
// Lvl3: literal column properties
25-
const value = parseValuetoSanitizeYamlValue(column[key].toString(), config);
25+
const value = parseValuetoSanitizeYamlValue(column[key]?.toString(), config);
2626
this.localDisk.push(`${YAML_INDENT.repeat(2)}${key}: ${value}`);
2727
});
2828

@@ -31,7 +31,7 @@ export class UnmarshallColumnsHandler extends AbstractDiskHandler {
3131

3232
// Lvl4: column config
3333
Object.keys(column.config).forEach(key => {
34-
const connfValue = parseValuetoSanitizeYamlValue(column.config[key].toString(), config);
34+
const connfValue = parseValuetoSanitizeYamlValue(column.config[key]?.toString(), config);
3535
this.localDisk.push(`${YAML_INDENT.repeat(3)}${key}: ${connfValue}`);
3636
});
3737
};

src/stateManagement/automations/handlers/RunFormulaHandlerAction.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ export default class RunFormulaHandlerAction extends AbstractTableAction<Automat
1919
}): Literal {
2020
const dynamicJS = 'return `' + input + '`';
2121
const func = new Function('row', 'ddbbConfig', 'db', dynamicJS);
22-
return func(row, config, db);
22+
const result = func(row, config, db);
23+
if (result === "undefined" || result === "null") {
24+
return '';
25+
}
26+
return result;
2327
}
2428
proxyFunction(input: string, row: RowDataType, config: LocalSettings, db: {
2529
[key: string]: unknown;

0 commit comments

Comments
 (0)