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 2021/03/29 23:46:08 UTC

[GitHub] [skywalking] wu-sheng commented on a change in pull request #6651: Fix NullPointerException when call "ReactiveRequestHolder.getHeaders"

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



##########
File path: apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-commons/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/commons/ReactiveRequestHolder.java
##########
@@ -37,7 +38,11 @@ public String getHeader(final String headerName) {
 
     @Override
     public Enumeration<String> getHeaders(final String headerName) {
-        return Collections.enumeration(this.serverHttpRequest.getHeaders().get(headerName));
+        List<String> values = this.serverHttpRequest.getHeaders().get(headerName);
+        if (values == null) {
+            return null;

Review comment:
       Is null expected  when use this method? You used to say returning an empty list.




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