mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-24 03:05:28 +01:00
Merge pull request #3184 from silverwolfg11/path-null-check
Null check for path environment variable.
This commit is contained in:
commit
e879ed7e41
@ -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