Author: sebb
Date: Tue Aug 14 03:43:12 2007
New Revision: 565699

URL: http://svn.apache.org/viewvc?view=rev&rev=565699
Log:
Allow for null URL in extracted list

Modified:
    
jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java

Modified: 
jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java?view=diff&rev=565699&r1=565698&r2=565699
==============================================================================
--- 
jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
 (original)
+++ 
jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
 Tue Aug 14 03:43:12 2007
@@ -1027,23 +1027,27 @@
                                Object binURL = urls.next();
                                try {
                                        URL url = (URL) binURL;
-                    String urlstr = url.toString();
-                    String urlStrEnc=encodeSpaces(urlstr);
-                    if (!urlstr.equals(urlStrEnc)){// There were some spaces 
in the URL
-                        try {
-                            url = new URL(urlStrEnc);
-                        } catch (MalformedURLException e) {
-                            res.addSubResult(errorResult(new 
Exception(urlStrEnc + " is not a correct URI"), res));
-                            res.setSuccessful(false);
-                            continue;
-                        }
-                    }
-                    if (pattern != null && !localMatcher.matches(urlStrEnc, 
pattern)) {
-                       continue; // we have a pattern and the URL does not 
match, so skip it
-                    }
-                    HTTPSampleResult binRes = sample(url, GET, false, 
frameDepth + 1);
-                                       res.addSubResult(binRes);
-                                       res.setSuccessful(res.isSuccessful() && 
binRes.isSuccessful());
+                                       if (url == null) {
+                                               log.warn("Null URL detected 
(should not happen)");
+                                       } else {
+                                               String urlstr = url.toString();
+                           String urlStrEnc=encodeSpaces(urlstr);
+                           if (!urlstr.equals(urlStrEnc)){// There were some 
spaces in the URL
+                               try {
+                                   url = new URL(urlStrEnc);
+                               } catch (MalformedURLException e) {
+                                   res.addSubResult(errorResult(new 
Exception(urlStrEnc + " is not a correct URI"), res));
+                                   res.setSuccessful(false);
+                                   continue;
+                               }
+                           }
+                           if (pattern != null && 
!localMatcher.matches(urlStrEnc, pattern)) {
+                               continue; // we have a pattern and the URL does 
not match, so skip it
+                           }
+                           HTTPSampleResult binRes = sample(url, GET, false, 
frameDepth + 1);
+                                               res.addSubResult(binRes);
+                                               
res.setSuccessful(res.isSuccessful() && binRes.isSuccessful());
+                                       }
                                } catch (ClassCastException e) {
                                        res.addSubResult(errorResult(new 
Exception(binURL + " is not a correct URI"), res));
                                        res.setSuccessful(false);



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to