From 6932aad751025013f94bb4ef0452fd56d6ff0cfa Mon Sep 17 00:00:00 2001 From: joseph le Date: Thu, 26 Oct 2023 07:38:25 +0700 Subject: [PATCH] update catch memory --- app/utils/sendDeviceInfor.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/utils/sendDeviceInfor.ts b/app/utils/sendDeviceInfor.ts index f8b8859..1fb5758 100644 --- a/app/utils/sendDeviceInfor.ts +++ b/app/utils/sendDeviceInfor.ts @@ -194,9 +194,9 @@ export const sendDeviceInfora = async () => { line.includes("bytes of memory") || line.includes("bytes of physical memory") ) - const mathches = stringMem[0].match(regexSPE) + const mathches = stringMem[0]?.match(regexSPE) - if(mathches && stringMem[0].includes("CHASSIS")){ + if(mathches && stringMem[0]?.includes("CHASSIS")){ console.log(mathches) PID = mathches[0].trim(); SN = showInventoryContent.filter((i)=>i.includes(mathches[0].trim()))[0]?.split("SN:")[1]?.replace(/,/g, "").trim();