diff --git a/src/commands/deliverability/access.ts b/src/commands/deliverability/access.ts index 6107341..920c0e6 100644 --- a/src/commands/deliverability/access.ts +++ b/src/commands/deliverability/access.ts @@ -109,12 +109,11 @@ export default class Access extends SfdxCommand { await accessLevelField?.select(accessLevelValue); await contentFrame?.click('#thePage\\:theForm\\:editBlock\\:buttons\\:saveBtn'); await contentFrame?.waitForSelector('#thePage\\:theForm\\:successText'); - await browser.close(); this.ux.stopSpinner('🎉 Email Deliverability Access Level has been set!'); } catch (err) { error = String(err); } finally { - if (browser !== undefined) await browser.close(); + await browser?.close(); if (error !== undefined) this.ux.stopSpinner(`❌ Access Level could not be set. The following error occurred:\n${String(error)}`); }