exilence-next icon indicating copy to clipboard operation
exilence-next copied to clipboard

Nullcheck activeProfile

Open viktorgullmark opened this issue 3 years ago • 0 comments

@computed get getSelectedAccount(): Account { const account = this.accounts.find((a) => a.uuid === this.activeAccount); return account ? account : new Account(); }

@computed get activeProfile() { return this.profiles.find((p) => p.active); }

We use activeProfile in different places, and sometimes with the ! operator. We should instead nullcheck it properly.

viktorgullmark avatar Mar 26 '21 20:03 viktorgullmark