From 9f40bb020eaea153eca77d3071a4f2cc8bcd2a8e Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Fri, 17 Jan 2020 10:56:51 +0800 Subject: [PATCH] fix dump non-exist log directory (#9818) --- cmd/dump.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/dump.go b/cmd/dump.go index 6cbf04c468ff..d4461bea9313 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 {