fix: accounting for a null container (#26605)
closes: #26604 Signed-off-by: Steve Hawkins <shawkins@redhat.com>
This commit is contained in:
parent
fa948f37e0
commit
2480fab6f9
1 changed files with 5 additions and 1 deletions
|
@ -23,6 +23,8 @@ import io.vertx.ext.web.RoutingContext;
|
|||
import org.jboss.resteasy.core.ResteasyContext;
|
||||
import org.keycloak.common.util.ResteasyProvider;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
public class ResteasyVertxProvider implements ResteasyProvider {
|
||||
|
||||
@Override
|
||||
|
@ -30,7 +32,9 @@ public class ResteasyVertxProvider implements ResteasyProvider {
|
|||
R data = ResteasyContext.getContextData(type);
|
||||
|
||||
if (data == null) {
|
||||
RoutingContext contextData = Arc.container().instance(CurrentVertxRequest.class).get().getCurrent();
|
||||
RoutingContext contextData = Optional.ofNullable(Arc.container())
|
||||
.map(c -> c.instance(CurrentVertxRequest.class).get()).map(CurrentVertxRequest::getCurrent)
|
||||
.orElse(null);
|
||||
|
||||
if (contextData == null) {
|
||||
return null;
|
||||
|
|
Loading…
Reference in a new issue