From 536950eeb336fb2aefc5d2096395c8858912fe81 Mon Sep 17 00:00:00 2001 From: Manuel Weiser Date: Wed, 26 Mar 2025 11:51:58 +0100 Subject: [PATCH] fix: handle potential undefined value for tray_info_idx in handleSpoolIn function, by @tugsi --- html/rfid.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/rfid.js b/html/rfid.js index d0d2f07..34680e6 100644 --- a/html/rfid.js +++ b/html/rfid.js @@ -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 } };