Skip to content

Commit d940682

Browse files
committed
[IO-502] Exceptions are suppressed incorrectly when copying files. Fix NPEs due to the patch.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/io/trunk@1741122 13f79535-47bb-0310-9956-ffa450edef68
1 parent e1c5de1 commit d940682

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

src/main/java/org/apache/commons/io/FileSystemUtils.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,23 @@ List<String> performCommand(final String[] cmdAttribs, final int max, final long
510510
"Command line did not return any info " +
511511
"for command " + Arrays.asList(cmdAttribs));
512512
}
513+
514+
inr.close();
515+
inr = null;
516+
517+
in.close();
518+
in = null;
519+
520+
if (out != null) {
521+
out.close();
522+
out = null;
523+
}
524+
525+
if (err != null) {
526+
err.close();
527+
err = null;
528+
}
529+
513530
return lines;
514531

515532
} catch (final InterruptedException ex) {

0 commit comments

Comments
 (0)