You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by pm...@apache.org on 2012/11/24 22:32:42 UTC

svn commit: r1413269 - /jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC3Impl.java

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