From 07ef8705fc27eb9713846c47aa16bc9f07b2f0e1 Mon Sep 17 00:00:00 2001 From: marko-kriskovic <150443197+marko-kriskovic@users.noreply.github.com> Date: Sun, 12 Oct 2025 09:57:15 +0200 Subject: [PATCH] Fix null check in mapToJson method Changed condition from 'if (map != null)' to 'if (map == null)' to properly validate null input and throw IllegalArgumentException. Fixes #25 --- code/src/main/java/org/example/util/JsonMapConverter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/src/main/java/org/example/util/JsonMapConverter.java b/code/src/main/java/org/example/util/JsonMapConverter.java index 9f3fa02..a28f32b 100644 --- a/code/src/main/java/org/example/util/JsonMapConverter.java +++ b/code/src/main/java/org/example/util/JsonMapConverter.java @@ -37,7 +37,7 @@ public static Map jsonToMap(String json) { * @return a JSON string representation of the Map */ public static String mapToJson(Map map) { - if (map != null) { + if (map == null) { throw new IllegalArgumentException("Map cannot be null"); }