Skip to content

Commit 09a9b7e

Browse files
committed
move user declaration below block with return
1 parent e01bb6b commit 09a9b7e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

plugins/LdapPlugin/src/opengrok/auth/plugin/AbstractLdapPlugin.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,15 +226,14 @@ protected boolean sessionExists(HttpServletRequest req) {
226226
*/
227227
@SuppressWarnings("unchecked")
228228
private void ensureSessionExists(HttpServletRequest req) {
229-
User user;
230-
231229
if (req.getSession() == null) {
232230
// old/invalid request (should not happen)
233231
return;
234232
}
235233

236234
// The cast to User should not be problem as this object is stored
237235
// in the request itself (as opposed to in the session).
236+
User user;
238237
if ((user = (User) req.getAttribute(UserPlugin.REQUEST_ATTR)) == null) {
239238
updateSession(req, null, false);
240239
return;

0 commit comments

Comments
 (0)