diff --git a/compiler/frontend/src/org/jetbrains/jet/config/CompilerConfiguration.java b/compiler/frontend/src/org/jetbrains/jet/config/CompilerConfiguration.java index 7faddc68fe8..5bf4b3f328b 100644 --- a/compiler/frontend/src/org/jetbrains/jet/config/CompilerConfiguration.java +++ b/compiler/frontend/src/org/jetbrains/jet/config/CompilerConfiguration.java @@ -70,6 +70,7 @@ public class CompilerConfiguration { public void addAll(@NotNull CompilerConfigurationKey> key, @NotNull Collection values) { checkReadOnly(); + checkForNullElements(values); Key> ideaKey = key.ideaKey; if (map.get(ideaKey) == null) { map.put(ideaKey, new ArrayList()); @@ -112,4 +113,15 @@ public class CompilerConfiguration { return object; } } + + private static void checkForNullElements(Collection values) { + int index = 0; + for (T value : values) { + if (value == null) { + throw new IllegalArgumentException("Element " + index + + " is null, while null values in compiler configuration are not allowed"); + } + index++; + } + } }