fix(cli): 🏷️ Handle possible undefined values on some variables

This commit is contained in:
Jesse Wierzbinski 2024-12-02 15:43:56 +01:00
parent e4768620e2
commit 57e17e7607
No known key found for this signature in database
2 changed files with 10 additions and 0 deletions

View file

@ -37,6 +37,11 @@ export default class FederationUserFetch extends BaseCommand<
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
await Instance.resolve(`https://${host}`);

View file

@ -38,6 +38,11 @@ export default class FederationUserFinger extends BaseCommand<
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
await Instance.resolve(`https://${host}`);