[object Object]

← back to Dw Five Field Step0

fix scan null-sku crash in bare-sku derivation

9f81672cd91551384d41a0496463d69d999a4584 · 2026-06-21 14:39:02 -0700 · steve

Files touched

Diff

commit 9f81672cd91551384d41a0496463d69d999a4584
Author: steve <steve@designerwallcoverings.com>
Date:   Sun Jun 21 14:39:02 2026 -0700

    fix scan null-sku crash in bare-sku derivation
---
 scripts/scan-live.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/scan-live.js b/scripts/scan-live.js
index 13c9b7c..380c97d 100644
--- a/scripts/scan-live.js
+++ b/scripts/scan-live.js
@@ -91,7 +91,8 @@ async function gql(cursor) {
       const sampleIdx = isSample.indexOf(true);
       const anyZero = prices.some(pp => pp == null || pp === 0);
       const txt = (p.descriptionHtml || '').replace(/<[^>]*>/g, '').trim();
-      const bare = (nonSampleIdx >= 0 ? vs[nonSampleIdx].sku : (vs[0]?.sku || '')).replace(/-Sample$/i, '');
+      const rawSku = (nonSampleIdx >= 0 ? vs[nonSampleIdx].sku : vs[0]?.sku) || '';
+      const bare = rawSku.replace(/-Sample$/i, '');
       batch.push({
         shopify_id: p.id, vendor: p.vendor, bare_sku: bare,
         has_sample: hasSample, has_product: hasProduct, any_zero: anyZero,

← 6d9656e fix scan DB auth: connect over unix socket (peer auth) like  ·  back to Dw Five Field Step0  ·  Step-0 definitive priceable-vs-hold split: active_five_field 568fee0 →