Skip to content

Commit

Permalink
Merge pull request #5 from storage-lock/dev
Browse files Browse the repository at this point in the history
fix: npe
  • Loading branch information
CC11001100 committed Sep 2, 2023
2 parents 80c3afa + 9e0be31 commit 324ece0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mongodb_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func (x *MongoStorage) CreateWithVersion(ctx context.Context, lockId string, ver

// 判断是否是id重复的错误
func (x *MongoStorage) isDuplicateKey(err error) bool {
if err != nil {
if err == nil {
return false
}
return strings.Contains(err.Error(), "id dup key") || strings.Contains(err.Error(), "_id_ dup key")
Expand Down

0 comments on commit 324ece0

Please sign in to comment.