Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilos Kleint2011-01-18 11:58:34 +0000
committerMilos Kleint2011-01-18 11:58:34 +0000
commit394296fe5d4b3c0a10095607053ecbd7ac2088af (patch)
treea44682c1c4c99159a5161b5eee29cd500cd0cdfb /org.eclipse.m2e.editor
parent0a02c14526c8ec13d06a0942304f1cd2ba041e03 (diff)
downloadm2e-core-394296fe5d4b3c0a10095607053ecbd7ac2088af.tar.gz
m2e-core-394296fe5d4b3c0a10095607053ecbd7ac2088af.tar.xz
m2e-core-394296fe5d4b3c0a10095607053ecbd7ac2088af.zip
MNGECLIPSE-2717 fix npe
Diffstat (limited to 'org.eclipse.m2e.editor')
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependencyLabelProvider.java22
1 files changed, 12 insertions, 10 deletions
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependencyLabelProvider.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependencyLabelProvider.java
index 50742999..2f109f57 100644
--- a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependencyLabelProvider.java
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependencyLabelProvider.java
@@ -113,17 +113,19 @@ public class DependencyLabelProvider extends LabelProvider implements IColorProv
}
}
org.eclipse.m2e.model.edit.pom.DependencyManagement dm = managementProvider.getValue();
- for (Dependency modelDep : dm.getDependencies()) {
- String modelGroupId = modelDep.getGroupId();
- String modelArtifactId = modelDep.getArtifactId();
- String modelVersion = modelDep.getVersion();
- if (modelGroupId != null && modelGroupId.equals(dep.getGroupId()) &&
- modelArtifactId != null && modelArtifactId.equals(dep.getArtifactId())) {
- if (version != null && (modelVersion == null || modelVersion.contains("${"))) {
- //prefer the resolved version to the model one if the model version as expressions..
- return version;
+ if (dm != null && dm.getDependencies() != null) {
+ for (Dependency modelDep : dm.getDependencies()) {
+ String modelGroupId = modelDep.getGroupId();
+ String modelArtifactId = modelDep.getArtifactId();
+ String modelVersion = modelDep.getVersion();
+ if (modelGroupId != null && modelGroupId.equals(dep.getGroupId()) && modelArtifactId != null
+ && modelArtifactId.equals(dep.getArtifactId())) {
+ if (version != null && (modelVersion == null || modelVersion.contains("${"))) {
+ //prefer the resolved version to the model one if the model version as expressions..
+ return version;
+ }
+ return modelVersion;
}
- return modelVersion;
}
}
}

Back to the top