Browse Source

Fix NPE on reading global config on MAC

Bug: 336610

Change-Id: Iefcb85e791723801faa315b3ee45fb19e3ca52fb
Signed-off-by: Jens Baumgart <jens.baumgart@sap.com>
tags/v0.11.1
Jens Baumgart 13 years ago
parent
commit
b82e4bf771
1 changed files with 6 additions and 1 deletions
  1. 6
    1
      org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java

+ 6
- 1
org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java View File

@@ -66,7 +66,12 @@ abstract class FS_POSIX extends FS {
String w = readPipe(userHome(), //
new String[] { "bash", "--login", "-c", "which git" }, //
Charset.defaultCharset().name());
return new File(w).getParentFile().getParentFile();
if (w == null || w.length() == 0)
return null;
File parentFile = new File(w).getParentFile();
if (parentFile == null)
return null;
return parentFile.getParentFile();
}

return null;

Loading…
Cancel
Save