Null-guard IOUtils.close(Closeable, IOConsumer).
MODIFY
src/changes/changes.xml
src/changes/changes.xml
@@ -89,6 +89,9 @@ The <action> type attribute can be add,update,fix,remove.
<action dev="ggregory" type="add" due-to="Gary Gregory">
Add PathUtils.getAclEntryList(Path).
</action>
+ <action dev="ggregory" type="add" due-to="Gary Gregory">
+ Null-guard IOUtils.close(Closeable, IOConsumer).
+ </action>
<action dev="ggregory" type="fix" due-to="Gary Gregory">
Replace FindBugs with SpotBugs.
</action>

MODIFY
src/main/java/org/apache/commons/io/IOUtils.java
src/main/java/org/apache/commons/io/IOUtils.java
@@ -372,12 +372,14 @@ public static void closeQuietly(final Closeable closeable, final Consumer<IOExce
* @since 2.7
*/
public static void close(final Closeable... closeables) throws IOException {
+ if (closeables != null) {
for (Closeable closeable : closeables) {
if (closeable != null) {
closeable.close();
}
}
}
+ }
/**
* Closes the given {@link Closeable} as a null-safe operation.

Null-guard IOUtils.close(Closeable, IOConsumer).