null pointer exception
- Dominant language
- Java
- Stars
- 43
- Forks
- 22
- PR merge metrics
- No merged PRs in 30d
Description
@RequestMapping(value = "/jobzilla/user/login", method = RequestMethod.POST)
public ResponseEntity login(@Valid @RequestBody User user) {
return userService.login(user);
}
following is the response part
public ResponseEntity login(@Valid User user) {
ResponseModel response = new ResponseModel();
User userlogin = userRepository.findByEmail(user.getEmail());
System.out.println("email");
if (user.getPassword().equals(userlogin.getPassword())) {
response.setResponseCode(HttpStatus.OK.toString());
response.setResponseDescription("Login Success");
response.setResponseObject(userlogin);
return new ResponseEntity(response, HttpStatus.OK);
}
return new ResponseEntity(response, HttpStatus.NO_CONTENT);
}
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the login methods shown in the issue and inspect the values returned by userRepository.findByEmail(user.getEmail()) and the request fields used in the password comparison. Reproduce the null pointer exception, identify which value is null, and verify that the login endpoint handles that case without the exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- authentication, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100