This is an automated email from the ASF dual-hosted git repository. elsloo pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git
commit 460bc048b6b46ed836a99f521717e6b157cd480b Author: Jesse Rivas <jesse_ri...@comcast.com> AuthorDate: Mon Feb 12 13:45:20 2018 -0700 Added null check. Fixes #1722 --- .../cdn/traffic_control/traffic_router/core/hash/ConsistentHasher.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/hash/ConsistentHasher.java b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/hash/ConsistentHasher.java index 91cbdb6..099ac7a 100644 --- a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/hash/ConsistentHasher.java +++ b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/hash/ConsistentHasher.java @@ -28,7 +28,8 @@ public class ConsistentHasher { final private MD5HashFunction hashFunction = new MD5HashFunction(); public <T extends Hashable> T selectHashable(final List<T> hashables, final Dispersion dispersion, final String s) { - return selectHashables(hashables, dispersion, s).get(0); + List<T> selectedHashables = selectHashables(hashables, dispersion, s); + return !selectedHashables.isEmpty() ? selectedHashables.get(0) : null; } public <T extends Hashable> List<T> selectHashables(final List<T> hashables, final String s) { -- To stop receiving notification emails like this one, please contact els...@apache.org.