mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-12-25 01:57:53 +01:00
Null check for path environment variable.
This commit is contained in:
parent
e962323e00
commit
87087a9c1e
@ -438,7 +438,12 @@ public class DynmapCore implements DynmapCommonAPI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private String findExecutableOnPath(String fname) {
|
private String findExecutableOnPath(String fname) {
|
||||||
for (String dirname : System.getenv("PATH").split(File.pathSeparator)) {
|
String path = System.getenv("PATH");
|
||||||
|
// Fast-fail if path is null.
|
||||||
|
if (path == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
for (String dirname : path.split(File.pathSeparator)) {
|
||||||
File file = new File(dirname, fname);
|
File file = new File(dirname, fname);
|
||||||
if (file.isFile() && file.canExecute()) {
|
if (file.isFile() && file.canExecute()) {
|
||||||
return file.getAbsolutePath();
|
return file.getAbsolutePath();
|
||||||
|
Loading…
Reference in New Issue
Block a user