diff --git a/internal/converter/options/converter_options.go b/internal/converter/options/converter_options.go index f39cea3..b7a91df 100644 --- a/internal/converter/options/converter_options.go +++ b/internal/converter/options/converter_options.go @@ -330,7 +330,10 @@ func (o *Options) SaveConfig() error { // GetProfile shortcut to get current profile func (o *Options) GetProfile() *profiles.Profile { - return o.profiles[o.Profile] + if p, ok := o.profiles[o.Profile]; ok { + return &p + } + return nil } // AvailableProfiles all available profiles diff --git a/internal/converter/profiles/converter_profiles.go b/internal/converter/profiles/converter_profiles.go index df404ac..e6d1357 100644 --- a/internal/converter/profiles/converter_profiles.go +++ b/internal/converter/profiles/converter_profiles.go @@ -13,7 +13,7 @@ type Profile struct { Height int `json:"height"` } -type Profiles map[string]*Profile +type Profiles map[string]Profile // New Initialize list of all supported profiles. func New() Profiles { @@ -52,7 +52,7 @@ func New() Profiles { {"RM1", "reMarkable 1", 1404, 1872}, {"RM2", "reMarkable 2", 1404, 1872}, } { - res[r.Code] = &r + res[r.Code] = r } return res }