diff --git a/src/commands/cwg.ts b/src/commands/cwg.ts index 11c9801..1f423a1 100644 --- a/src/commands/cwg.ts +++ b/src/commands/cwg.ts @@ -126,11 +126,13 @@ export default class CWG extends Command { }); this.client.signale.debug(resultID.data); const recordID = resultID.data.result[0].id; - await axios({ + if (resultID.data.result[0]) { + await axios({ method: 'delete', url: `https://api.cloudflare.com/client/v4/zones/5e82fc3111ed4fbf9f58caa34f7553a7/dns_records/${recordID}`, headers: { Authorization: `Bearer ${this.client.config.cloudflare}` }, }); + } } await fs.unlink(`/etc/nginx/sites-available/${domain.domain}`); await fs.unlink(`/etc/nginx/sites-enabled/${domain.domain}`);