From f7667198959f12f5627e22f8a46c35dfd1c9196c Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Fri, 17 Jan 2020 13:02:41 +0800 Subject: [PATCH] fix dump non-exist log directory (#9818) (#9819) --- cmd/dump.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/dump.go b/cmd/dump.go index 6cbf04c46..d4461bea9 100644 --- a/cmd/dump.go +++ b/cmd/dump.go @@ -151,8 +151,10 @@ func runDump(ctx *cli.Context) error { } } - if err := z.AddDir("log", setting.LogRootPath); err != nil { - fatal("Failed to include log: %v", err) + if com.IsExist(setting.LogRootPath) { + if err := z.AddDir("log", setting.LogRootPath); err != nil { + fatal("Failed to include log: %v", err) + } } if err = z.Close(); err != nil {