Do not try to copy logo if image does not exist on disk
This commit is contained in:
11
core/core.go
11
core/core.go
@@ -128,13 +128,12 @@ func resetDirectories() {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
|
||||
// Remove the previous thumbnail
|
||||
os.Remove(filepath.Join(config.WebRoot, "thumbnail.jpg"))
|
||||
|
||||
// Remove the previous thumbnail
|
||||
logo := data.GetLogoPath()
|
||||
err = utils.Copy(path.Join("data", logo), "webroot/thumbnail.jpg")
|
||||
if err != nil {
|
||||
log.Warnln(err)
|
||||
if utils.DoesFileExists(logo) {
|
||||
err = utils.Copy(path.Join("data", logo), filepath.Join(config.WebRoot, "thumbnail.jpg"))
|
||||
if err != nil {
|
||||
log.Warnln(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user