From 60c8cbd1f229070f9116063b00149d5d6dcc2bee Mon Sep 17 00:00:00 2001 From: Matthias Hanel Date: Tue, 13 Oct 2020 01:30:03 -0400 Subject: [PATCH] Fixed crash on non existing directory Signed-off-by: Matthias Hanel --- server/opts.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/opts.go b/server/opts.go index 38be14d1..42bbad95 100644 --- a/server/opts.go +++ b/server/opts.go @@ -875,7 +875,7 @@ func (o *Options) processConfigFileLine(k string, v interface{}, errors *[]error *errors = append(*errors, &configErr{tk, "dir has no value and needs to point to a directory"}) return } - if info, err := os.Stat(dir); err != nil && (!info.IsDir() || info.Mode().Perm()&(1<<(uint(7))) == 0) { + if info, _ := os.Stat(dir); info != nil && (!info.IsDir() || info.Mode().Perm()&(1<<(uint(7))) == 0) { *errors = append(*errors, &configErr{tk, "dir needs to point to an accessible directory"}) return }