From fc5ca690a618c7506997c654b4360ce74a557bef Mon Sep 17 00:00:00 2001 From: Manolo Carrasco Date: Wed, 8 Feb 2012 09:33:43 +0000 Subject: [PATCH] Fix a null condition when converting properties to json strings --- .../java/com/google/gwt/query/client/Properties.java | 9 ++++----- 1 file 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; + } } } } -- 2.39.5