mirror of
https://github.com/shadowfacts/jinput-arm64.git
synced 2025-12-06 08:01:59 +01:00
Guard against null pointer
This commit is contained in:
parent
c8996c0581
commit
64ec6fe8e4
|
|
@ -1,4 +1,4 @@
|
||||||
/**
|
/*
|
||||||
* Copyright (C) 2003 Jeremy Booth (jeremy@newdawnsoftware.com)
|
* Copyright (C) 2003 Jeremy Booth (jeremy@newdawnsoftware.com)
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|
@ -439,11 +439,16 @@ public final class LinuxEnvironmentPlugin extends ControllerEnvironment implemen
|
||||||
return (File[]) AccessController.doPrivileged(new PrivilegedAction() {
|
return (File[]) AccessController.doPrivileged(new PrivilegedAction() {
|
||||||
public Object run() {
|
public Object run() {
|
||||||
File[] files = dir.listFiles(filter);
|
File[] files = dir.listFiles(filter);
|
||||||
|
if(files == null) {
|
||||||
|
logln("dir " + dir.getName() + " exists: " + dir.exists() + ", is writable: " + dir.isDirectory());
|
||||||
|
files = new File[]{};
|
||||||
|
} else {
|
||||||
Arrays.sort(files, new Comparator() {
|
Arrays.sort(files, new Comparator() {
|
||||||
public int compare(Object f1, Object f2) {
|
public int compare(Object f1, Object f2) {
|
||||||
return ((File) f1).getName().compareTo(((File) f2).getName());
|
return ((File) f1).getName().compareTo(((File) f2).getName());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
return files;
|
return files;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue