jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1413269 - /jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC3Impl.java
Date Sat, 24 Nov 2012 21:32:42 GMT
Author: pmouawad
Date: Sat Nov 24 21:32:41 2012
New Revision: 1413269

URL: http://svn.apache.org/viewvc?rev=1413269&view=rev
Log:
Fix potentiel NPE if method is unknown

Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC3Impl.java

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC3Impl.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC3Impl.java?rev=1413269&r1=1413268&r2=1413269&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC3Impl.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC3Impl.java
Sat Nov 24 21:32:41 2012
@@ -340,7 +340,10 @@ public class HTTPHC3Impl extends HTTPHCA
         } catch (IllegalArgumentException e) { // e.g. some kinds of invalid URL
             res.sampleEnd();
             // pick up headers if failed to execute the request
-            res.setRequestHeaders(getConnectionHeaders(httpMethod));
+            // httpMethod can be null if method is unexpected
+            if(httpMethod != null) {
+                res.setRequestHeaders(getConnectionHeaders(httpMethod));
+            }
             errorResult(e, res);
             return res;
         } catch (IOException e) {



Mime
View raw message