From ad3e01b2ee2834f570899c62657d27de91060351 Mon Sep 17 00:00:00 2001 From: Thomas E Lackey Date: Thu, 29 Feb 2024 01:05:55 +0000 Subject: [PATCH] r can be null --- src/deployments.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/deployments.ts b/src/deployments.ts index cc4ef66..1c52706 100644 --- a/src/deployments.ts +++ b/src/deployments.ts @@ -50,12 +50,15 @@ export class RegHelper { } else { const records = await this.registry.resolveNames([name]); for (const r of records) { - this.cache.set(r.id, r); - if (Array.isArray(r.names)) { - for (const n of r.names) { - this.cache.set(n, r); + // r can be null + if (!r) { + this.cache.set(r.id, r); + if (Array.isArray(r.names)) { + for (const n of r.names) { + this.cache.set(n, r); + } } - } + } } return records[0]; }