diff options
author | Manolo Carrasco <manolo@apache.org> | 2012-02-08 09:33:43 +0000 |
---|---|---|
committer | Manolo Carrasco <manolo@apache.org> | 2012-02-08 09:33:43 +0000 |
commit | fc5ca690a618c7506997c654b4360ce74a557bef (patch) | |
tree | 5bd99ccc69d67d3e0ede9cea3d57560f1716a987 | |
parent | 68d20da52e8fffdc25faf2ae02b467691d53ffc0 (diff) | |
download | gwtquery-fc5ca690a618c7506997c654b4360ce74a557bef.tar.gz gwtquery-fc5ca690a618c7506997c654b4360ce74a557bef.zip |
Fix a null condition when converting properties to json strings
-rw-r--r-- | gwtquery-core/src/main/java/com/google/gwt/query/client/Properties.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/Properties.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/Properties.java index cb7cbfb7..398960e3 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/Properties.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/Properties.java @@ -141,10 +141,6 @@ public class Properties extends JavaScriptObject { for (String k : keys()){
String ky = k.matches("\\d+") ? k : "\"" + k + "\"";
- // We do not have to restore gwt hashCodes.
- if (k.equals("$H")) {
- continue;
- }
JsCache o = getArray(k).cast();
if (o != null) {
ret += ky + ":[";
@@ -191,7 +187,10 @@ public class Properties extends JavaScriptObject { if (p != null) {
ret += p.toQueryString();
} else {
- ret += k + "=" + getStr(k);
+ String v = getStr(k);
+ if (v != null && !v.isEmpty() && !"null".equalsIgnoreCase(v)) {
+ ret += k + "=" + v;
+ }
}
}
}
|