From 80eb82420e94357ef1c303adbbfd6024c41c225f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Wed, 28 Sep 2016 21:12:25 +0200 Subject: [PATCH] fix(cleanup): check if images dir exists --- pkg/services/cleanup/cleanup.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/services/cleanup/cleanup.go b/pkg/services/cleanup/cleanup.go index fcc75762fd4..ffaa75de9cc 100644 --- a/pkg/services/cleanup/cleanup.go +++ b/pkg/services/cleanup/cleanup.go @@ -52,6 +52,10 @@ func (service *CleanUpService) start(ctx context.Context) error { } func (service *CleanUpService) cleanUpTmpFiles() { + if _, err := os.Stat(setting.ImagesDir); os.IsNotExist(err) { + return + } + files, err := ioutil.ReadDir(setting.ImagesDir) if err != nil { service.log.Error("Problem reading image dir", "error", err)