Skip to content

Commit 2d8fb4f

Browse files
committed
fixed NPE issue 26 #26
1 parent 1626e69 commit 2d8fb4f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/org/restheart/security/handlers/SecurityHandler.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ public void handleRequest(HttpServerExchange exchange, RequestContext context) t
5151
}
5252

5353
private static PipedHttpHandler getSecurityHandlerChain(final PipedHttpHandler next, final IdentityManager identityManager, final AccessManager accessManager, final boolean challenging) {
54-
PipedHttpHandler handler = null;
5554
if (identityManager != null) {
5655
final List<AuthenticationMechanism> mechanisms = new ArrayList<>();
5756

@@ -63,8 +62,9 @@ private static PipedHttpHandler getSecurityHandlerChain(final PipedHttpHandler n
6362
mechanisms.add(new SilentBasicAuthenticationMechanism(RESTHEART_REALM));
6463
}
6564

66-
handler = buildSecurityHandlerChain(next, accessManager, identityManager, mechanisms);
65+
return buildSecurityHandlerChain(next, accessManager, identityManager, mechanisms);
66+
} else {
67+
return next;
6768
}
68-
return handler;
6969
}
7070
}

0 commit comments

Comments
 (0)