zifeihan edited a comment on issue #6481:
URL: https://github.com/apache/skywalking/issues/6481#issuecomment-790377757


   > And I think that we should add a null check for 
`ContextManager.activeSpan()` in `CallbackInterceptor.handleMethodException`:
   
   Sorry this is my hand error. 
   
   
   > ```
   > @Override
   > public void handleMethodException(EnhancedInstance objInst, Method method, 
Object[] allArguments,
   >     Class<?>[] argumentsTypes, Throwable t) {
   >     ContextManager.activeSpan().log(t);
   > }
   > ```
   
   How about using this judgment,
   ```
       public void handleMethodException(EnhancedInstance objInst, Method 
method, Object[] allArguments,
           Class<?>[] argumentsTypes, Throwable t) {
           CallbackCache cache = (CallbackCache) 
objInst.getSkyWalkingDynamicField();
           if (null != cache) {
               ContextManager.activeSpan().log(t);
           }
       }
   ```


----------------------------------------------------------------
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:
[email protected]


Reply via email to