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:
@ -56,7 +56,8 @@ func (p *Provider) Set(s *xorm.Session, img *background.Image, project *models.P
|
||||
// Remove the old background if one exists
|
||||
if project.BackgroundFileID != 0 {
|
||||
file := files.File{ID: project.BackgroundFileID}
|
||||
if err := file.Delete(); err != nil {
|
||||
err := file.Delete()
|
||||
if err != nil && !files.IsErrFileDoesNotExist(err) {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user