From c32e6134b3442e0a9399d3cce242c7d462a86ad5 Mon Sep 17 00:00:00 2001 From: Vilsol Date: Tue, 7 Jun 2022 07:49:24 +0300 Subject: [PATCH] do not apply profile to installation if no installation is selected --- tea/root.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tea/root.go b/tea/root.go index 39a6b8c..e411770 100644 --- a/tea/root.go +++ b/tea/root.go @@ -39,8 +39,10 @@ func (m *rootModel) GetCurrentProfile() *cli.Profile { func (m *rootModel) SetCurrentProfile(profile *cli.Profile) error { m.global.Profiles.SelectedProfile = profile.Name - if err := m.GetCurrentInstallation().SetProfile(m.global, profile.Name); err != nil { - return errors.Wrap(err, "failed setting profile on installation") + if m.GetCurrentInstallation() != nil { + if err := m.GetCurrentInstallation().SetProfile(m.global, profile.Name); err != nil { + return errors.Wrap(err, "failed setting profile on installation") + } } return nil