Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRené Purrio2018-01-15 07:46:29 -0500
committerRené Purrio2018-01-15 07:46:29 -0500
commit7a2def0bd858ffff807a9631895561e7a95de86f (patch)
tree2214ca8cdc121f79fa6ac8fac7e160ed4f445435 /org.eclipse.search.tests
parent357a31b4c7ded6a2f6b68107d2ada54e8960344c (diff)
downloadeclipse.platform.text-7a2def0bd858ffff807a9631895561e7a95de86f.tar.gz
eclipse.platform.text-7a2def0bd858ffff807a9631895561e7a95de86f.tar.xz
eclipse.platform.text-7a2def0bd858ffff807a9631895561e7a95de86f.zip
Bug 529816 - [sonar] Resolve "Possible null pointer dereference"
Change-Id: I23fe76a2f516770d8917d33a6c61d3b47d4fc397 Signed-off-by: René Purrio <rpurrio@itemis.de>
Diffstat (limited to 'org.eclipse.search.tests')
-rw-r--r--org.eclipse.search.tests/src/org/eclipse/search/tests/FileTool.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/org.eclipse.search.tests/src/org/eclipse/search/tests/FileTool.java b/org.eclipse.search.tests/src/org/eclipse/search/tests/FileTool.java
index 26568301a..7a7aa6868 100644
--- a/org.eclipse.search.tests/src/org/eclipse/search/tests/FileTool.java
+++ b/org.eclipse.search.tests/src/org/eclipse/search/tests/FileTool.java
@@ -141,6 +141,9 @@ public class FileTool {
public static void copy(File src, File dst) throws IOException {
if(src.isDirectory()){
String[] srcChildren = src.list();
+ if (srcChildren == null) {
+ throw new IOException("Content from directory '" + src.getAbsolutePath() + "' can not be listed."); //$NON-NLS-1$ //$NON-NLS-2$
+ }
for(int i = 0; i < srcChildren.length; ++i){
File srcChild= new File(src, srcChildren[i]);
File dstChild= new File(dst, srcChildren[i]);

Back to the top