Skip to content

Commit 8adfd7a

Browse files
committed
Fix for NPE on older Hadoop APIs
1 parent 81f68ed commit 8adfd7a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/org/apache/hadoop/fs/glusterfs/GlusterVolume.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@ public GlusterVolume(Configuration conf){
6969
this.setConf(conf);
7070
}
7171

72-
public URI getUri() { return NAME; }
72+
public URI getUri() {
73+
if(NAME==null) return URI.create("glusterfs:///");
74+
return NAME;
75+
}
7376

7477
public void initialize(URI uri, Configuration conf) throws IOException {
7578
/* we only really care about the URI up to the path, so strip other things off */

0 commit comments

Comments
 (0)