From 24bb100c6d50a451a8689bbf7d4347772427572a Mon Sep 17 00:00:00 2001 From: Edgar Asatryan Date: Sat, 29 Jun 2019 16:42:17 +0400 Subject: [PATCH] Return empty unmodifiable set when no registered modules types. --- .../java/com/fasterxml/jackson/databind/ObjectMapper.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/fasterxml/jackson/databind/ObjectMapper.java b/src/main/java/com/fasterxml/jackson/databind/ObjectMapper.java index 16716be1a5..4e1ab83166 100644 --- a/src/main/java/com/fasterxml/jackson/databind/ObjectMapper.java +++ b/src/main/java/com/fasterxml/jackson/databind/ObjectMapper.java @@ -988,9 +988,10 @@ public ObjectMapper registerModules(Iterable modules) * * @since 2.9.6 */ - public Set getRegisteredModuleIds() - { - return Collections.unmodifiableSet(_registeredModuleTypes); + public Set getRegisteredModuleIds() { + return _registeredModuleTypes == null ? + Collections.emptySet() : + Collections.unmodifiableSet(_registeredModuleTypes); } /**