1
0

fix(project background): add more checks for whether a background file exists when duplicating or deleting a project

Related discussion: https://community.vikunja.io/t/500-internal-server-error-when-selecting-unsplash-background-image/778/18
This commit is contained in:
kolaente
2023-09-13 11:20:40 +02:00
parent 191c154150
commit 1ee243f2bd
4 changed files with 63 additions and 41 deletions

View File

@ -1030,7 +1030,12 @@ func (p *Project) DeleteBackgroundFileIfExists() (err error) {
}
file := files.File{ID: p.BackgroundFileID}
return file.Delete()
err = file.Delete()
if err != nil && files.IsErrFileDoesNotExist(err) {
return nil
}
return err
}
// SetProjectBackground sets a background file as project background in the db