From 0f7437e91dc32a70d97887642739ba3d6fb2c46a Mon Sep 17 00:00:00 2001 From: Rishabh Gupta Date: Tue, 11 Feb 2025 08:20:19 +0530 Subject: [PATCH 1/2] fix: handle the null values of pcbComponent --- lib/utils/get-footprint-name.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/utils/get-footprint-name.ts b/lib/utils/get-footprint-name.ts index e23bad2..26a9665 100644 --- a/lib/utils/get-footprint-name.ts +++ b/lib/utils/get-footprint-name.ts @@ -7,7 +7,7 @@ export function getFootprintName( if (!sourceComponent || !pcbComponent) { return "" } - const width = pcbComponent.width.toFixed(4) - const height = pcbComponent.height.toFixed(4) + const width = pcbComponent.width == null ? 0 : pcbComponent.width.toFixed(4) + const height = pcbComponent.height == null ? 0 : pcbComponent.height.toFixed(4) return `${sourceComponent.ftype}:${width}x${height}_mm` } From 7f64ddc43884266f6127471e9785ad98f6f0493a Mon Sep 17 00:00:00 2001 From: tscircuitbot Date: Tue, 11 Feb 2025 02:51:09 +0000 Subject: [PATCH 2/2] formatbot: Automatically format code --- lib/utils/get-footprint-name.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/utils/get-footprint-name.ts b/lib/utils/get-footprint-name.ts index 26a9665..07f1136 100644 --- a/lib/utils/get-footprint-name.ts +++ b/lib/utils/get-footprint-name.ts @@ -8,6 +8,7 @@ export function getFootprintName( return "" } const width = pcbComponent.width == null ? 0 : pcbComponent.width.toFixed(4) - const height = pcbComponent.height == null ? 0 : pcbComponent.height.toFixed(4) + const height = + pcbComponent.height == null ? 0 : pcbComponent.height.toFixed(4) return `${sourceComponent.ftype}:${width}x${height}_mm` }