From a19af267cf1b85ef0f6be31cd80da7720ba6ef9d Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Tue, 16 Jan 2024 01:14:42 -0500 Subject: [PATCH] fix: try to deref? --- storage/storage.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 }