Skip to content

Commit

Permalink
fix: Redeemer is null
Browse files Browse the repository at this point in the history
  • Loading branch information
CubeWhy authored Oct 14, 2024
1 parent c3c66ed commit 6e5e125
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public ResponseEntity<RestBean<String>> forgetPassword(@RequestBody ForgetPasswo
}

RedeemCode redeemCode = redeemService.infoOrNull(dto.getRedeemCode());
if (redeemCode == null || redeemCode.isAvailable() || redeemCode.getRedeemer().getId().equals(user.getId())) {
if (redeemCode == null || redeemCode.isAvailable() || redeemCode.getRedeemer() == null || !redeemCode.getRedeemer().getId().equals(user.getId())) {
// 邀请码找不到或者根本没被人用过
// 写到一起是为了防止被刷API
return new ResponseEntity<>(RestBean.failure(404, "Code not found."), HttpStatus.NOT_FOUND);
Expand Down

0 comments on commit 6e5e125

Please sign in to comment.