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
1 changed files with 8 additions and 4 deletions
|
@ -190,10 +190,14 @@ public class File implements Serializable
|
||||||
if (x.isDirectory())
|
if (x.isDirectory())
|
||||||
return true;
|
return true;
|
||||||
String p = x.getPath();
|
String p = x.getPath();
|
||||||
x.setPath(x.getParent());
|
String parent = x.getParent();
|
||||||
if (! mkdirs (x))
|
if (parent != null)
|
||||||
return false;
|
{
|
||||||
x.setPath(p);
|
x.setPath(parent);
|
||||||
|
if (! mkdirs (x))
|
||||||
|
return false;
|
||||||
|
x.setPath(p);
|
||||||
|
}
|
||||||
return x.mkdir();
|
return x.mkdir();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue