From 5169f0f3938fe231e4a73d2b55a42d38a92d5383 Mon Sep 17 00:00:00 2001 From: Anindya Chatterjee Date: Thu, 26 Sep 2024 10:08:55 +0530 Subject: [PATCH] Update NitriteDocument.java --- .../java/org/dizitart/no2/collection/NitriteDocument.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nitrite/src/main/java/org/dizitart/no2/collection/NitriteDocument.java b/nitrite/src/main/java/org/dizitart/no2/collection/NitriteDocument.java index 8cf2f5ec..05a36f53 100644 --- a/nitrite/src/main/java/org/dizitart/no2/collection/NitriteDocument.java +++ b/nitrite/src/main/java/org/dizitart/no2/collection/NitriteDocument.java @@ -308,6 +308,10 @@ private void deepPut(String[] splits, Object value) { throw new ValidationException("Invalid key provided"); } String key = splits[0]; + if (isNullOrEmpty(key)) { + throw new ValidationException("Invalid key provided"); + } + if (splits.length == 1) { // if last key, simply put in the current document put(key, value);