summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2016-12-29 00:37:59 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2016-12-29 00:59:31 +0100
commit48b772bec1b65da04072b4239119da759547865f (patch)
tree89872160e367cbf99c0f204579c968b1e5c88a7d
parent44936a121698ea7fd8ceb1fe6fe97b75bb781614 (diff)
downloadjgit-48b772bec1b65da04072b4239119da759547865f.tar.gz
jgit-48b772bec1b65da04072b4239119da759547865f.zip
[findBugs] Fix potential NPE in DirCacheCheckoutTest
Change-Id: I842cbdd14bf56cb2bd599255fe90a5a3aea0d304 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java
index bb553a444e..388456f949 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java
@@ -1705,7 +1705,8 @@ public class DirCacheCheckoutTest extends RepositoryTestCase {
+ " in workDir. ", buffer, i.get(path).getBytes());
nrFiles++;
} else if (file.isDirectory()) {
- if (file.list().length == 0) {
+ String[] files = file.list();
+ if (files != null && files.length == 0) {
assertEquals("found unexpected empty folder for path "
+ path + " in workDir. ", "/", i.get(path));
nrFiles++;