Check that EXIF contains date shot before comparing
This should fix #196
This commit is contained in:
parent
529444561b
commit
557b5e22df
|
@ -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")
|
||||
|
|
Loading…
Reference in New Issue