From 9c81443792af2ed847ea3dcc110f73f512a9d692 Mon Sep 17 00:00:00 2001 From: Jan Bartel Date: Tue, 1 May 2018 11:41:01 +1000 Subject: [PATCH] Issue #2482 Protect against NPE in MemcachedSessionDataMapFactory --- .../session/MemcachedSessionDataMapFactory.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/jetty-memcached/jetty-memcached-sessions/src/main/java/org/eclipse/jetty/memcached/session/MemcachedSessionDataMapFactory.java b/jetty-memcached/jetty-memcached-sessions/src/main/java/org/eclipse/jetty/memcached/session/MemcachedSessionDataMapFactory.java index f0ea275015a..82f83928c39 100644 --- a/jetty-memcached/jetty-memcached-sessions/src/main/java/org/eclipse/jetty/memcached/session/MemcachedSessionDataMapFactory.java +++ b/jetty-memcached/jetty-memcached-sessions/src/main/java/org/eclipse/jetty/memcached/session/MemcachedSessionDataMapFactory.java @@ -44,9 +44,12 @@ public class MemcachedSessionDataMapFactory implements SessionDataMapFactory { if (addresses == null) _addresses = null; - _addresses = new ArrayList<>(); - for (InetSocketAddress a:addresses) - _addresses.add(a); + else + { + _addresses = new ArrayList<>(); + for (InetSocketAddress a:addresses) + _addresses.add(a); + } } /**