Skip to content

Commit ed25486

Browse files
jansupolsenivam
authored andcommitted
prevent NPE when WebAppException#getResponse returns null
Signed-off-by: jansupol <[email protected]>
1 parent c3d3132 commit ed25486

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core-server/src/main/java/org/glassfish/jersey/server/ServerRuntime.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012, 2022 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2012, 2024 Oracle and/or its affiliates. All rights reserved.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -526,7 +526,7 @@ private Response mapException(final Throwable originalThrowable) throws Throwabl
526526
processingContext.routingContext().setMappedThrowable(throwable);
527527

528528
waeResponse = webApplicationException.getResponse();
529-
if (waeResponse.hasEntity()) {
529+
if (waeResponse != null && waeResponse.hasEntity()) {
530530
LOGGER.log(Level.FINE, LocalizationMessages
531531
.EXCEPTION_MAPPING_WAE_ENTITY(waeResponse.getStatus()), throwable);
532532
return waeResponse;

0 commit comments

Comments
 (0)