Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

null pointer exception #19

Open
prachihjadhav opened this issue Aug 11, 2020 · 0 comments
Open

null pointer exception #19

prachihjadhav opened this issue Aug 11, 2020 · 0 comments

Comments

@prachihjadhav
Copy link

prachihjadhav commented Aug 11, 2020

@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);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant