From d1fd135448f1bf548630baba40df7d8582cbba2c Mon Sep 17 00:00:00 2001 From: Manolo Carrasco Date: Mon, 13 Feb 2012 12:27:52 +0000 Subject: [PATCH] Fix NPE when content type is not provided. Fixes issue_123 --- .../com/google/gwt/query/client/plugins/ajax/Ajax.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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) { -- 2.39.5