From b4a6bff21fae7afd71613bcba57330656797aa36 Mon Sep 17 00:00:00 2001 From: zhangyan Date: Mon, 15 Jun 2026 17:03:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E6=8C=89=E9=92=AE=E5=90=8EJS=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E5=AF=BC=E8=87=B4=E6=95=B0=E6=8D=AE=E4=B8=8D=E6=B8=B2?= =?UTF-8?q?=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 01-verify-inspection.html 添加 topBackBtn 空值保护 - 避免 document.getElementById('topBackBtn') 返回 null 时 JS 崩溃 Co-Authored-By: Claude Opus 4.6 --- .../raw-veg-inspection-scale/01-verify-inspection.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/other-module/canteen-device/raw-veg-inspection-scale/01-verify-inspection.html b/other-module/canteen-device/raw-veg-inspection-scale/01-verify-inspection.html index 9ad4bd5..4ad651d 100644 --- a/other-module/canteen-device/raw-veg-inspection-scale/01-verify-inspection.html +++ b/other-module/canteen-device/raw-veg-inspection-scale/01-verify-inspection.html @@ -1160,11 +1160,12 @@ /* 根据来源设置返回目标页 */ refererPage = detectRefererPage(); - document.getElementById('topBackBtn').href = refererPage; + var backBtn = document.getElementById('topBackBtn'); + if (backBtn) backBtn.href = refererPage; initDirectSupplierSelect(); renderOrderCards(); - bindBackBtn(); + if (backBtn) bindBackBtn(); bindCameraClick(); }