From: Manolo Carrasco Date: Mon, 13 Feb 2012 12:27:52 +0000 (+0000) Subject: Fix NPE when content type is not provided. Fixes issue_123 X-Git-Tag: release-1.3.2~118 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d1fd135448f1bf548630baba40df7d8582cbba2c;p=gwtquery.git Fix NPE when content type is not provided. Fixes issue_123 --- diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/ajax/Ajax.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/ajax/Ajax.java index a8f60a8a..86f5c1cd 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/ajax/Ajax.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/ajax/Ajax.java @@ -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) {