try/catch
This commit is contained in:
1 parent
ad3e01b2ee
commit
b9cdc036ed
2 files changed
+43
-23
No files matched your search
+2
-2
@@ -51,14 +51,14 @@ export class RegHelper {
|
||||
const records = await this.registry.resolveNames([name]);
|
||||
for (const r of records) {
|
||||
// r can be null
|
||||
if (!r) {
|
||||
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];
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user