Skip to content

Commit

Permalink
Filter out invalid values before processing them on pipeline change (#67
Browse files Browse the repository at this point in the history
)
  • Loading branch information
caponetto authored Oct 10, 2024
1 parent d53e8da commit 31ae810
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions packages/pipeline-editor/src/PipelineEditorWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -348,17 +348,17 @@ const PipelineWrapper: React.FC<IProps> = ({
} else if (Array.isArray(data[key])) {
const newArray = [];
for (const i in data[key]) {
if (typeof data[key][i] === 'object') {
removeNullValues(data[key][i], true);
if (Object.keys(data[key][i]).length > 0) {
newArray.push(data[key][i]);
const item = data[key][i];
if (item === undefined || item === null || item === '') {
continue;
}
if (typeof item === 'object') {
removeNullValues(item, true);
if (Object.keys(item).length > 0) {
newArray.push(item);
}
} else if (
data[key][i] !== undefined &&
data[key][i] !== null &&
data[key][i] !== ''
) {
newArray.push(data[key][i]);
} else {
newArray.push(item);
}
}
data[key] = newArray;
Expand Down

0 comments on commit 31ae810

Please sign in to comment.