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:
@ -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
|
||||
|
Reference in New Issue
Block a user