]> source.dussan.org Git - gwtquery.git/commitdiff
Fix NPE when content type is not provided. Fixes issue_123
authorManolo Carrasco <manolo@apache.org>
Mon, 13 Feb 2012 12:27:52 +0000 (12:27 +0000)
committerManolo Carrasco <manolo@apache.org>
Mon, 13 Feb 2012 12:27:52 +0000 (12:27 +0000)
gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/ajax/Ajax.java

index a8f60a8a4d35629f60b64ecb3ba12a7973ff4628..86f5c1cd37966703c4d6b198c05968778af7b4a2 100644 (file)
@@ -193,8 +193,11 @@ public class Ajax extends GQuery {
     if (password != null) {
       requestBuilder.setPassword(password);
     }
-
-    requestBuilder.setHeader("Content-type", settings.getContentType());
+    
+    String contentType = settings.getContentType();
+    if (contentType != null) {
+      requestBuilder.setHeader("Content-type", settings.getContentType());
+    }
 
     Properties headers = settings.getHeaders();
     if (headers != null) {