Skip to content

Commit

Permalink
prevent panic (#3118)
Browse files Browse the repository at this point in the history
  • Loading branch information
woutslakhorst authored May 15, 2024
1 parent 4c5afc8 commit dfb1d80
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions discovery/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,15 @@ func (s *sqlStore) add(serviceID string, presentation vc.VerifiablePresentation,
if timestamp == 0 {
var newTs *int
newTs, err = s.incrementTimestamp(tx, serviceID)
if err != nil {
return err
}
timestamp = *newTs
} else {
err = s.setTimestamp(tx, serviceID, timestamp)
}
if err != nil {
return err
if err != nil {
return err
}
}
// Delete any previous presentations of the subject
if err := tx.Delete(&presentationRecord{}, "service_id = ? AND credential_subject_id = ?", serviceID, credentialSubjectID.String()).
Expand Down

0 comments on commit dfb1d80

Please sign in to comment.