diff options
author | Adolfo Panizo <adolfo.panizo@gmail.com> | 2014-03-04 13:38:26 +0100 |
---|---|---|
committer | Adolfo Panizo <adolfo.panizo@gmail.com> | 2014-03-04 13:38:26 +0100 |
commit | 5430b6bbe29fc6e5ac7e1ba2e3709e7731b2db2c (patch) | |
tree | 1d3ed3f7b80f13c465ca97710f5a65f123a4f4b7 | |
parent | 28b68df025e52a4c39a9e55b1e0196cdbb057045 (diff) | |
download | gwtquery-5430b6bbe29fc6e5ac7e1ba2e3709e7731b2db2c.tar.gz gwtquery-5430b6bbe29fc6e5ac7e1ba2e3709e7731b2db2c.zip |
Exception when parsing empty response.getText(), and the dataType is
necessary for the request.
-rw-r--r-- | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/ajax/Ajax.java | 3 |
1 files changed, 3 insertions, 0 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 e11e5923..e98749ae 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 @@ -145,6 +145,9 @@ public class Ajax extends GQuery { Response response = arguments(0); Request request = arguments(1); Object retData = response.getText(); + if (response.getText() == null || response.getText().isEmpty()) { + return new Object[]{response.getText(), "success", request, response}; + } try { if ("xml".equalsIgnoreCase(dataType)) { retData = JsUtils.parseXML(response.getText()); |