HHH-10715 Missing null check after File.listFiles

This commit is contained in:
Sanne Grinovero 2020-10-10 21:51:26 +01:00
parent b518df7da4
commit a7629c4382
1 changed files with 7 additions and 3 deletions

View File

@ -241,11 +241,15 @@ public class EnhancementTask extends Task {
private void walkDir(File dir, FileFilter classesFilter, FileFilter dirFilter) {
File[] dirs = dir.listFiles( dirFilter );
for ( File dir1 : dirs ) {
walkDir( dir1, classesFilter, dirFilter );
if ( dirs != null ) {
for ( File dir1 : dirs ) {
walkDir( dir1, classesFilter, dirFilter );
}
}
File[] files = dir.listFiles( classesFilter );
Collections.addAll( sourceSet, files );
if ( files != null ) {
Collections.addAll( sourceSet, files );
}
}
private void writeOutEnhancedClass(byte[] enhancedBytecode, File file) throws BuildException {