You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2018/08/20 23:18:42 UTC

[GitHub] wu-sheng closed pull request #1562: FIX NPE in tomcat plugin ForwardInterceptor

wu-sheng closed pull request #1562: FIX NPE in tomcat plugin ForwardInterceptor
URL: https://github.com/apache/incubator-skywalking/pull/1562
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/apm-sniffer/apm-sdk-plugin/tomcat-7.x-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/tomcat78x/ForwardInterceptor.java b/apm-sniffer/apm-sdk-plugin/tomcat-7.x-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/tomcat78x/ForwardInterceptor.java
index f7b255ace..68416c7ed 100644
--- a/apm-sniffer/apm-sdk-plugin/tomcat-7.x-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/tomcat78x/ForwardInterceptor.java
+++ b/apm-sniffer/apm-sdk-plugin/tomcat-7.x-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/tomcat78x/ForwardInterceptor.java
@@ -37,7 +37,7 @@ public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allAr
         if (ContextManager.isActive()) {
             AbstractSpan abstractTracingSpan = ContextManager.activeSpan();
             Map<String, String> eventMap = new HashMap<String, String>();
-            eventMap.put("forward-url", (String)objInst.getSkyWalkingDynamicField());
+            eventMap.put("forward-url", objInst.getSkyWalkingDynamicField() == null ? "" : String.valueOf(objInst.getSkyWalkingDynamicField()));
             abstractTracingSpan.log(System.currentTimeMillis(), eventMap);
             ContextManager.getRuntimeContext().put(Constants.FORWARD_REQUEST_FLAG, true);
         }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services