r can be null
This commit is contained in:
parent
359607488c
commit
ad3e01b2ee
@ -50,12 +50,15 @@ export class RegHelper {
|
|||||||
} else {
|
} else {
|
||||||
const records = await this.registry.resolveNames([name]);
|
const records = await this.registry.resolveNames([name]);
|
||||||
for (const r of records) {
|
for (const r of records) {
|
||||||
this.cache.set(r.id, r);
|
// r can be null
|
||||||
if (Array.isArray(r.names)) {
|
if (!r) {
|
||||||
for (const n of r.names) {
|
this.cache.set(r.id, r);
|
||||||
this.cache.set(n, r);
|
if (Array.isArray(r.names)) {
|
||||||
|
for (const n of r.names) {
|
||||||
|
this.cache.set(n, r);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return records[0];
|
return records[0];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user