diff options
author | xxxserxxx <60757196+xxxserxxx@users.noreply.github.com> | 2020-04-16 08:38:38 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-16 08:38:38 -0500 |
commit | 84ec9e4e7ac0dc9fdf52badeb6fed0d45f38d1e2 (patch) | |
tree | 9446292a712b5b0b17789ce278c20fa4ce49b1fc | |
parent | 30ddd1bc33de5db0d5c7cc0c4c591e6cf1c0a9fd (diff) | |
parent | 43227744e7ed9821c4543fa1d6212a6f9418ceb9 (diff) |
Merge pull request #81 from markuspeloquin/master
Fix crash when loading a custom colorscheme
-rw-r--r-- | colorschemes/registry.go | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/colorschemes/registry.go b/colorschemes/registry.go index 8f86491..b6263c9 100644 --- a/colorschemes/registry.go +++ b/colorschemes/registry.go @@ -18,14 +18,11 @@ func init() { } func FromName(confDir configdir.ConfigDir, c string) (Colorscheme, error) { - cs, ok := registry[c] - if !ok { - cs, err := getCustomColorscheme(confDir, c) - if err != nil { - return cs, err - } + if cs, ok := registry[c]; ok { + return cs, nil } - return cs, nil + cs, err := getCustomColorscheme(confDir, c) + return cs, err } func register(name string, c Colorscheme) { |