]> source.dussan.org Git - gitea.git/commitdiff
fix dump non-exist log directory (#9818) (#9820)
authorLunny Xiao <xiaolunwen@gmail.com>
Fri, 17 Jan 2020 07:51:21 +0000 (15:51 +0800)
committerAntoine GIRARD <sapk@users.noreply.github.com>
Fri, 17 Jan 2020 07:51:21 +0000 (08:51 +0100)
Co-authored-by: Lauris BH <lauris@nix.lv>
cmd/dump.go

index 1bf6901769fbcc1a5da2b016327ade9b4594f219..2de8278a297c8afdaf0f5a6c0ba3a00b81935be8 100644 (file)
@@ -145,8 +145,10 @@ func runDump(ctx *cli.Context) error {
                }
        }
 
-       if err := z.AddDir("log", setting.LogRootPath); err != nil {
-               log.Fatalf("Failed to include log: %v", err)
+       if com.IsExist(setting.LogRootPath) {
+               if err := z.AddDir("log", setting.LogRootPath); err != nil {
+                       log.Fatalf("Failed to include log: %v", err)
+               }
        }
 
        if err = z.Close(); err != nil {