From 9c34c3f344d0146184442580657c6dbabf4ebde7 Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Wed, 18 May 2016 19:26:28 +0900 Subject: [PATCH] Fix NPE when creating DomainNameMapping via a builder --- common/src/main/java/io/netty/util/DomainNameMapping.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/io/netty/util/DomainNameMapping.java b/common/src/main/java/io/netty/util/DomainNameMapping.java index b15a0ae67f..d1734aa712 100644 --- a/common/src/main/java/io/netty/util/DomainNameMapping.java +++ b/common/src/main/java/io/netty/util/DomainNameMapping.java @@ -68,7 +68,8 @@ public class DomainNameMapping implements Mapping { DomainNameMapping(Map map, V defaultValue) { this.defaultValue = checkNotNull(defaultValue, "defaultValue"); this.map = map; - unmodifiableMap = Collections.unmodifiableMap(map); + unmodifiableMap = map != null ? Collections.unmodifiableMap(map) + : null; } /**