svn commit: r904311 - /jakarta/jmeter/trunk/src/components/org/apache/jmeter/extractor/XPathExtractor.java

[email protected]
Newsgroups gmane.comp.jakarta.jmeter.devel
Message-ID <[email protected]>
Author: sebb
Date: Thu Jan 28 23:56:34 2010
New Revision: 904311

URL: http://svn.apache.org/viewvc?rev=904311&view=rev
Log:
Don't attempt to process null samples

Modified:
    jakarta/jmeter/trunk/src/components/org/apache/jmeter/extractor/XPathExtractor.java

Modified: jakarta/jmeter/trunk/src/components/org/apache/jmeter/extractor/XPathExtractor.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/components/org/apache/jmeter/extractor/XPathExtractor.java?rev=904311&r1=904310&r2=904311&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/components/org/apache/jmeter/extractor/XPathExtractor.java (original)
+++ jakarta/jmeter/trunk/src/components/org/apache/jmeter/extractor/XPathExtractor.java Thu Jan 28 23:56:34 2010
@@ -109,12 +109,15 @@
      */
     public void process() {
         JMeterContext context = getThreadContext();
+        final SampleResult previousResult = context.getPreviousResult();
+        if (previousResult == null){
+            return;
+        }
         JMeterVariables vars = context.getVariables();
         String refName = getRefName();
         vars.put(refName, getDefaultValue());
         vars.put(concat(refName,MATCH_NR), "0"); // In case parse fails // $NON-NLS-1$
         vars.remove(concat(refName,"1")); // In case parse fails // $NON-NLS-1$
-        final SampleResult previousResult = context.getPreviousResult();
 
         try{
             Document d = parseResponse(previousResult);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.