From ffb753de9fdcf1cf808e7f2bcd0cd1d66adb27a8 Mon Sep 17 00:00:00 2001 From: anna Date: Mon, 21 Dec 2009 17:41:30 +0300 Subject: [PATCH] NPE (null scope in dependency rule should be forbidden) --- .../packageDependencies/DependencyValidationManagerImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/packageDependencies/DependencyValidationManagerImpl.java b/platform/lang-impl/src/com/intellij/packageDependencies/DependencyValidationManagerImpl.java index b9be64f97f..e259cb81ad 100644 --- a/platform/lang-impl/src/com/intellij/packageDependencies/DependencyValidationManagerImpl.java +++ b/platform/lang-impl/src/com/intellij/packageDependencies/DependencyValidationManagerImpl.java @@ -284,6 +284,9 @@ public class DependencyValidationManagerImpl extends DependencyValidationManager String toScope = ruleElement.getAttributeValue(TO_SCOPE_KEY); String denyRule = ruleElement.getAttributeValue(IS_DENY_KEY); if (fromScope == null || toScope == null || denyRule == null) return null; - return new DependencyRule(getScope(fromScope), getScope(toScope), Boolean.valueOf(denyRule).booleanValue()); + final NamedScope fromNamedScope = getScope(fromScope); + final NamedScope toNamedScope = getScope(toScope); + if (fromNamedScope == null || toNamedScope == null) return null; + return new DependencyRule(fromNamedScope, toNamedScope, Boolean.valueOf(denyRule).booleanValue()); } } -- 2.11.4.GIT