Browse Source

guard against empty name oobe

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@536356 13f79535-47bb-0310-9956-ffa450edef68
master
Matthew Jason Benson 18 years ago
parent
commit
e9a41d2a09
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      src/main/org/apache/tools/ant/types/resources/URLResource.java

+ 5
- 2
src/main/org/apache/tools/ant/types/resources/URLResource.java View File

@@ -128,8 +128,11 @@ public class URLResource extends Resource {
* @return the name of this resource. * @return the name of this resource.
*/ */
public synchronized String getName() { public synchronized String getName() {
return isReference() ? ((Resource) getCheckedRef()).getName()
: getURL().getFile().substring(1);
if (isReference()) {
return ((Resource) getCheckedRef()).getName();
}
String name = getURL().getFile();
return "".equals(name) ? name : name.substring(1);
} }


/** /**


Loading…
Cancel
Save