Closed Bug 475768 Opened 16 years ago Closed 16 years ago

[java backend] NPE in Register.login()

Categories

(Skywriter Graveyard :: Server, defect, P4)

defect

Tracking

(Not tracked)

RESOLVED WONTFIX
Future

People

(Reporter: simon_kaegi, Unassigned)

Details

User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 1.1.4322; .NET CLR 3.0.04506.648) Build Identifier: In the final block of login() we need to re-retrieve the session that was is newly created by storeLoggedInUser(result). If we don't we get an NPE when we call this.printUserJSON(session.username). -- // -- if you are already logged in return UserSession session = (UserSession) getCtx().getReq().getSession(true).getAttribute("userSession"); if (session != null && session.username.equals(username)) { this.printUserJSON(session.username); } else { String result = getAuthenticator().authenticate(getCtx(), username, password); if (result != null) { storeLoggedInUser(result); // ADDED this line to avoid the NPE session = (UserSession) getCtx().getReq().getSession(true).getAttribute("userSession"); this.printUserJSON(session.username); } } Reproducible: Always Steps to Reproduce: 1. 2. 3.
Priority: -- → P4
Whiteboard: server
Target Milestone: -- → Future
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows XP → All
Hardware: x86 → All
Version: unspecified → Trunk
This is a mass migration from Mozilla Labs :: Bespin to Bespin :: Server.
Component: Bespin → Server
Product: Mozilla Labs → Bespin
QA Contact: bespin → server
Whiteboard: server
We won't be maintaining the java back-end for the foreseeable future
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.