mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-12-24 17:47:40 +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) {
|
||||
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);
|
||||
if (file.isFile() && file.canExecute()) {
|
||||
return file.getAbsolutePath();
|
||||
|
Loading…
Reference in New Issue
Block a user