From a3fee826f1aafd57c5285323eea6627f642f8b63 Mon Sep 17 00:00:00 2001 From: gVisor bot Date: Fri, 21 Dec 2018 10:55:21 +0800 Subject: [PATCH] Fix: parse external-ui --- config/config.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/config/config.go b/config/config.go index f7e69c5c..8e48f8c7 100644 --- a/config/config.go +++ b/config/config.go @@ -153,12 +153,14 @@ func parseGeneral(cfg *rawConfig) (*General, error) { mode := cfg.Mode logLevel := cfg.LogLevel - if !filepath.IsAbs(externalUI) { - externalUI = filepath.Join(C.Path.HomeDir(), externalUI) - } + if externalUI != "" { + if !filepath.IsAbs(externalUI) { + externalUI = filepath.Join(C.Path.HomeDir(), externalUI) + } - if _, err := os.Stat(externalUI); os.IsNotExist(err) { - return nil, fmt.Errorf("external-ui: %s not exist", externalUI) + if _, err := os.Stat(externalUI); os.IsNotExist(err) { + return nil, fmt.Errorf("external-ui: %s not exist", externalUI) + } } general := &General{