Skip to content

Commit

Permalink
[FIXED JENKINS-17402] getItem may return null but may not throw IAE.
Browse files Browse the repository at this point in the history
Originally-Committed-As: 7fa8fe4096d0134f598a9d475df1c6199b9b05e7
  • Loading branch information
jglick committed Apr 25, 2013
1 parent 7c02ff9 commit 8f9e0fe
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/hudson/maven/MavenModuleSet.java
Expand Up @@ -434,7 +434,11 @@ public Collection<MavenModule> getModules() {
}

public MavenModule getItem(String name) {
return modules.get(ModuleName.fromString(name));
try {
return modules.get(ModuleName.fromString(name));
} catch (IllegalArgumentException x) {
return null; // not a Maven module name, ignore
}
}

public MavenModule getModule(String name) {
Expand Down

0 comments on commit 8f9e0fe

Please sign in to comment.