FIX: Pipeline save settings - Handle undefined valves property (#19791)

### FIX: Pipeline save settings - Handle undefined valves property

When a Pipeline valve have a null value the settings isn't saved.
The error occurs because the code tries to call `.split()` on a `null` value when saving pipeline valves.
This happens when you set a valve to "None" (null) and then click save.

This PR Fix this issue.
This commit is contained in:
_00_ 2025-12-08 16:09:53 +01:00 committed by GitHub
parent ce945a9334
commit 8cea0cf746
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -47,7 +47,7 @@
if (pipeline && (pipeline?.valves ?? false)) { if (pipeline && (pipeline?.valves ?? false)) {
for (const property in valves_spec.properties) { for (const property in valves_spec.properties) {
if (valves_spec.properties[property]?.type === 'array') { if (valves_spec.properties[property]?.type === 'array') {
valves[property] = valves[property].split(',').map((v) => v.trim()); valves[property] = (valves[property] ?? '').split(',').map((v) => v.trim());
} }
} }