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);