Skip to content

Commit

Permalink
Merge pull request #56 from SkynetLabs/ivo/fix_nil_pointer
Browse files Browse the repository at this point in the history
Fix a nil pointer.
  • Loading branch information
ro-tex authored Aug 25, 2022
2 parents e321395 + 32f32c7 commit af1e2c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion database/skylink.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ func (db *DB) UnlockSkylink(ctx context.Context, skylink skymodules.Skylink, ser
},
}
ur, err := db.staticDB.Collection(collSkylinks).UpdateOne(ctx, filter, update)
if errors.Contains(err, mongo.ErrNoDocuments) || ur.ModifiedCount == 0 {
if errors.Contains(err, mongo.ErrNoDocuments) || (err == nil && ur.ModifiedCount == 0) {
return ErrNoSkylinksLocked
}
return err
Expand Down

0 comments on commit af1e2c8

Please sign in to comment.