Skip to content

Commit 849260b

Browse files
authored
Fix WebLogic NPE (#1142)
1 parent 2d30f32 commit 849260b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

apm-agent-plugins/apm-servlet-plugin/src/main/java/co/elastic/apm/agent/servlet/ServletTransactionHelper.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,11 @@ public static void setUsernameIfUnset(@Nullable String userName, TransactionCont
155155
@VisibleForAdvice
156156
public void onAfter(Transaction transaction, @Nullable Throwable exception, boolean committed, int status,
157157
boolean overrideStatusCodeOnThrowable, String method, @Nullable Map<String, String[]> parameterMap,
158-
String servletPath, @Nullable String pathInfo, @Nullable String contentTypeHeader, boolean deactivate) {
158+
@Nullable String servletPath, @Nullable String pathInfo, @Nullable String contentTypeHeader, boolean deactivate) {
159+
if (servletPath == null) {
160+
// the servlet path is specified as non-null but WebLogic does return null...
161+
servletPath = "";
162+
}
159163
try {
160164
// thrown the first time a JSP is invoked in order to register it
161165
if (exception != null && "weblogic.servlet.jsp.AddToMapException".equals(exception.getClass().getName())) {

0 commit comments

Comments
 (0)