mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 16:38:19 +01:00
fix(cli): 🏷️ Handle possible undefined values on some variables
This commit is contained in:
parent
e4768620e2
commit
57e17e7607
|
|
@ -37,6 +37,11 @@ export default class FederationUserFetch extends BaseCommand<
|
||||||
|
|
||||||
const { username, domain: host } = parseUserAddress(args.address);
|
const { username, domain: host } = parseUserAddress(args.address);
|
||||||
|
|
||||||
|
if (!host) {
|
||||||
|
this.log("Address must contain a domain.");
|
||||||
|
this.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
// Check instance exists, if not, create it
|
// Check instance exists, if not, create it
|
||||||
await Instance.resolve(`https://${host}`);
|
await Instance.resolve(`https://${host}`);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,11 @@ export default class FederationUserFinger extends BaseCommand<
|
||||||
|
|
||||||
const { username, domain: host } = parseUserAddress(args.address);
|
const { username, domain: host } = parseUserAddress(args.address);
|
||||||
|
|
||||||
|
if (!host) {
|
||||||
|
this.log("Address must contain a domain.");
|
||||||
|
this.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
// Check instance exists, if not, create it
|
// Check instance exists, if not, create it
|
||||||
await Instance.resolve(`https://${host}`);
|
await Instance.resolve(`https://${host}`);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue