Fix NPE if directory can't be accessed.

(Olof-Joachim Frahm)

C.f. <http://abcl.org/trac/ticket/233>.

From
<https://github.com/Ferada/abcl/commit/bdce7703a044b9ce5b02f3af87af309395e2f30e>.
parent 958acb82
...@@ -1667,6 +1667,11 @@ public class Pathname extends LispObject { ...@@ -1667,6 +1667,11 @@ public class Pathname extends LispObject {
if (f.isDirectory()) { if (f.isDirectory()) {
try { try {
File[] files = f.listFiles(); File[] files = f.listFiles();
if (files == null) {
return error(new FileError("Unable to list directory "
+ pathname.princToString() + ".",
pathname));
}
for (int i = files.length; i-- > 0;) { for (int i = files.length; i-- > 0;) {
File file = files[i]; File file = files[i];
Pathname p; Pathname p;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment