wu-sheng commented on a change in pull request #5989:
URL: https://github.com/apache/skywalking/pull/5989#discussion_r546591476



##########
File path: 
apm-sniffer/apm-sdk-plugin/thrift-plugin/src/main/java/org/apache/skywalking/apm/plugin/thrift/wrapper/ServerInProtocolWrapper.java
##########
@@ -81,6 +85,24 @@ public TField readFieldBegin() throws TException {
             }
             return readFieldBegin();
         }
+        if (field.type == TType.STOP) {
+            Boolean haveCreatedSpan =
+                    (Boolean) 
ContextManager.getRuntimeContext().get(HAVE_CREATED_SPAN);
+            if (!haveCreatedSpan) {

Review comment:
       This is still an NPE risk. Take a look at my previous comment. If you 
are using `Boolean`, you need to `haveCreatedSpan != null &&` first.
   
   If you are not familiar with auto-unboxing in Java, take a look at this, 
https://stackoverflow.com/questions/55100449/unexpected-nullpointerexception-while-autoboxing-unboxing-java-long-type-as-re
   




----------------------------------------------------------------
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