fix: try to deref?

This commit is contained in:
Derrick Hammer 2024-01-16 01:14:42 -05:00
parent 58f734d3b3
commit a19af267cf
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 4 additions and 1 deletions

View File

@ -109,7 +109,10 @@ func (s *StorageServiceImpl) FileExists(hash []byte) (bool, models.Upload) {
hashStr := hex.EncodeToString(hash) hashStr := hex.EncodeToString(hash)
var upload models.Upload var upload models.Upload
result := s.portal.Db().Model(&models.Upload{}).Where(&models.Upload{Hash: hashStr}).First(&upload)
db := *s.portal.Db()
result := db.Model(&models.Upload{}).Where(&models.Upload{Hash: hashStr}).First(&upload)
return result.RowsAffected > 0, upload return result.RowsAffected > 0, upload
} }