You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2010/04/28 06:38:13 UTC

svn commit: r938784 - in /camel/trunk/components: camel-http/src/main/java/org/apache/camel/component/http/DefaultHttpBinding.java camel-http4/src/main/java/org/apache/camel/component/http4/DefaultHttpBinding.java

Author: ningjiang
Date: Wed Apr 28 04:38:13 2010
New Revision: 938784

URL: http://svn.apache.org/viewvc?rev=938784&view=rev
Log:
CAMEL-2679 Fixed the NPE of DefaultHttpBinding

Modified:
    camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/DefaultHttpBinding.java
    camel/trunk/components/camel-http4/src/main/java/org/apache/camel/component/http4/DefaultHttpBinding.java

Modified: camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/DefaultHttpBinding.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/DefaultHttpBinding.java?rev=938784&r1=938783&r2=938784&view=diff
==============================================================================
--- camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/DefaultHttpBinding.java (original)
+++ camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/DefaultHttpBinding.java Wed Apr 28 04:38:13 2010
@@ -92,7 +92,9 @@ public class DefaultHttpBinding implemen
         
         // reset the stream cache
         StreamCache cache = message.getBody(StreamCache.class);
-        cache.reset();
+        if (cache != null) {
+            cache.reset();
+        }
         
         // store the method and query and other info in headers
         headers.put(Exchange.HTTP_METHOD, request.getMethod());

Modified: camel/trunk/components/camel-http4/src/main/java/org/apache/camel/component/http4/DefaultHttpBinding.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-http4/src/main/java/org/apache/camel/component/http4/DefaultHttpBinding.java?rev=938784&r1=938783&r2=938784&view=diff
==============================================================================
--- camel/trunk/components/camel-http4/src/main/java/org/apache/camel/component/http4/DefaultHttpBinding.java (original)
+++ camel/trunk/components/camel-http4/src/main/java/org/apache/camel/component/http4/DefaultHttpBinding.java Wed Apr 28 04:38:13 2010
@@ -91,7 +91,9 @@ public class DefaultHttpBinding implemen
         popluateRequestParameters(request, message);
         // reset the stream cache
         StreamCache cache = message.getBody(StreamCache.class);
-        cache.reset();
+        if (cache != null) {
+            cache.reset();
+        }
         
         // store the method and query and other info in headers
         headers.put(Exchange.HTTP_METHOD, request.getMethod());