summaryrefslogtreecommitdiff
path: root/internal/repository/share.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/repository/share.go')
-rw-r--r--internal/repository/share.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/internal/repository/share.go b/internal/repository/share.go
index 22da2fc..a7c0b8d 100644
--- a/internal/repository/share.go
+++ b/internal/repository/share.go
@@ -24,7 +24,9 @@ func (s *SQLite) CreateShare(ctx context.Context, share *model.Share) error {
func scanShare(row sqlScanner) (*model.Share, error) {
var sh model.Share
var maxUses sql.NullInt64
- if err := row.Scan(&sh.Token, &sh.MediaID, &sh.CreatedBy, &sh.CreatedAt, &sh.ExpiresAt, &maxUses, &sh.UsedCount); err != nil {
+ if err := row.Scan(&sh.Token, &sh.MediaID, &sh.CreatedBy, &sh.CreatedAt, &sh.ExpiresAt, &maxUses, &sh.UsedCount); err == sql.ErrNoRows {
+ return nil, nil
+ } else if err != nil {
return nil, err
}
if maxUses.Valid {