1
Fork 0

Check that EXIF contains date shot before comparing

This should fix #196
This commit is contained in:
viktorstrate 2021-02-14 15:45:58 +01:00
parent 529444561b
commit 557b5e22df
No known key found for this signature in database
GPG Key ID: 3F855605109C1E8A
1 changed files with 1 additions and 1 deletions

View File

@ -47,7 +47,7 @@ func SaveEXIF(tx *gorm.DB, media *models.Media) (*models.MediaEXIF, error) {
return nil, errors.Wrap(err, "save media exif to database")
}
if !exif.DateShot.Equal(media.DateShot) {
if exif.DateShot != nil && !exif.DateShot.Equal(media.DateShot) {
media.DateShot = *exif.DateShot
if err := tx.Save(media).Error; err != nil {
return nil, errors.Wrap(err, "update media date_shot")