Skip to content

Commit

Permalink
Fix nil memory access
Browse files Browse the repository at this point in the history
  • Loading branch information
cl-bvl committed May 15, 2022
1 parent 642cb74 commit 134e850
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions storage/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ import (
// In some cases S3 return ETag with "W/" prefix which mean that it not strong ETag.
// For easier compare we remove this prefix.
func StrongEtag(s *string) *string {
etag := strings.TrimPrefix(*s, "W/")
return &etag
if s != nil {
etag := strings.TrimPrefix(*s, "W/")
return &etag
}
return s
}

// ErrHandlingMask is is a bitmask for storing error handling settings.
Expand Down

0 comments on commit 134e850

Please sign in to comment.