Browse Source

Check parentFile is not null

parentFile becomes null when f is relative path, such as ".".

This patch avoids NullPointerException in such case.

Change-Id: I4752674b1daab6eedd7c3650c7749462810eaffd
Signed-off-by: Hiroshi Tomita <tomykaira@gmail.com>
tags/v3.0.2.201309041250-rc2
Hiroshi Tomita 10 years ago
parent
commit
781b0b5735

+ 1
- 1
org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java View File

@@ -475,7 +475,7 @@ public class DirCacheCheckout {
private void removeEmptyParents(File f) {
File parentFile = f.getParentFile();

while (!parentFile.equals(repo.getWorkTree())) {
while (parentFile != null && !parentFile.equals(repo.getWorkTree())) {
if (!parentFile.delete())
break;
parentFile = parentFile.getParentFile();

Loading…
Cancel
Save