File.java (mkdirs): Handle a null parent directory.
h * java/io/File.java (mkdirs): Handle a null parent directory. From-SVN: r26903
This commit is contained in:
parent
c41dc2ffe9
commit
7f8e55a0b9
@ -190,10 +190,14 @@ public class File implements Serializable
|
||||
if (x.isDirectory())
|
||||
return true;
|
||||
String p = x.getPath();
|
||||
x.setPath(x.getParent());
|
||||
if (! mkdirs (x))
|
||||
return false;
|
||||
x.setPath(p);
|
||||
String parent = x.getParent();
|
||||
if (parent != null)
|
||||
{
|
||||
x.setPath(parent);
|
||||
if (! mkdirs (x))
|
||||
return false;
|
||||
x.setPath(p);
|
||||
}
|
||||
return x.mkdir();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user