diff --git a/storage/storage.go b/storage/storage.go index 5b5592e..101e4b2 100644 --- a/storage/storage.go +++ b/storage/storage.go @@ -109,7 +109,10 @@ func (s *StorageServiceImpl) FileExists(hash []byte) (bool, models.Upload) { hashStr := hex.EncodeToString(hash) 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 }