diff options
Diffstat (limited to 'common-app-api')
-rw-r--r-- | common-app-api/src/main/java/org/openecomp/sdc/common/util/JsonUtils.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/common-app-api/src/main/java/org/openecomp/sdc/common/util/JsonUtils.java b/common-app-api/src/main/java/org/openecomp/sdc/common/util/JsonUtils.java index be534d2909..c76310ecf4 100644 --- a/common-app-api/src/main/java/org/openecomp/sdc/common/util/JsonUtils.java +++ b/common-app-api/src/main/java/org/openecomp/sdc/common/util/JsonUtils.java @@ -24,6 +24,10 @@ import com.google.gson.JsonObject; public class JsonUtils { + private JsonUtils() { + + } + public static String toString(JsonElement jsonElement) { if (jsonElement == null) { return null; @@ -48,6 +52,9 @@ public class JsonUtils { } public static boolean isEmptyJson(final JsonElement json) { + if (json == null || json.isJsonNull()) { + return true; + } if (json.isJsonArray()) { return json.getAsJsonArray().isEmpty(); } |