From b328fa74a7ef4b4a27d9e0ab1c502f06a406c9de Mon Sep 17 00:00:00 2001 From: Luck Date: Thu, 16 Feb 2017 21:45:43 +0000 Subject: [PATCH] Clarify thrown exception when a null context is returned --- .../lucko/luckperms/common/utils/ExtractedContexts.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/common/src/main/java/me/lucko/luckperms/common/utils/ExtractedContexts.java b/common/src/main/java/me/lucko/luckperms/common/utils/ExtractedContexts.java index 25e81972..6182b62e 100644 --- a/common/src/main/java/me/lucko/luckperms/common/utils/ExtractedContexts.java +++ b/common/src/main/java/me/lucko/luckperms/common/utils/ExtractedContexts.java @@ -52,6 +52,7 @@ public class ExtractedContexts { } private ExtractedContexts(ContextSet contexts) { + this.contexts = null; setup(contexts); } @@ -64,4 +65,11 @@ public class ExtractedContexts { this.contextSet = contextSet.makeImmutable(); } + + public Contexts getContexts() { + if (contexts == null) { + throw new NullPointerException("contexts"); + } + return contexts; + } }