fix: handle potential undefined value for tray_info_idx in handleSpoolIn function, by @tugsi

This commit is contained in:
Manuel Weiser 2025-03-26 11:51:58 +01:00
parent 43719aac41
commit 536950eeb3

View File

@ -490,7 +490,7 @@ function handleSpoolIn(amsId, trayId) {
nozzle_temp_max: parseInt(maxTemp),
type: selectedSpool.filament.material,
brand: selectedSpool.filament.vendor.name,
tray_info_idx: selectedSpool.filament.extra.bambu_idx.replace(/['"]+/g, '').trim(),
tray_info_idx: selectedSpool.filament.extra.bambu_idx?.replace(/['"]+/g, '').trim() || '',
cali_idx: "-1" // Default-Wert setzen
}
};