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 2020/04/25 09:51:41 UTC

[GitHub] [skywalking] huangyoje commented on a change in pull request #4712: Fix npe in afterMethod/handleMethodException of kafka/finagle plugins

huangyoje commented on a change in pull request #4712:
URL: https://github.com/apache/skywalking/pull/4712#discussion_r415027435



##########
File path: apm-sniffer/apm-sdk-plugin/kafka-plugin/src/main/java/org/apache/skywalking/apm/plugin/kafka/KafkaConsumerInterceptor.java
##########
@@ -51,6 +51,9 @@ public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allAr
     @Override
     public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
         Object ret) throws Throwable {
+        if (ret == null) {

Review comment:
       According to `InstMethodsInter`, if the intercepted method(here is `KafkaConsumer.pollOnce()`) throws exception, the ret will be null.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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