mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Add null checks to closeQuietly calls.
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=139738429
This commit is contained in:
parent
6dbfdecbe0
commit
adc9dd1c75
1 changed files with 6 additions and 2 deletions
|
|
@ -210,7 +210,9 @@ public final class Util {
|
||||||
*/
|
*/
|
||||||
public static void closeQuietly(DataSource dataSource) {
|
public static void closeQuietly(DataSource dataSource) {
|
||||||
try {
|
try {
|
||||||
dataSource.close();
|
if (dataSource != null) {
|
||||||
|
dataSource.close();
|
||||||
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// Ignore.
|
// Ignore.
|
||||||
}
|
}
|
||||||
|
|
@ -224,7 +226,9 @@ public final class Util {
|
||||||
*/
|
*/
|
||||||
public static void closeQuietly(Closeable closeable) {
|
public static void closeQuietly(Closeable closeable) {
|
||||||
try {
|
try {
|
||||||
closeable.close();
|
if (closeable != null) {
|
||||||
|
closeable.close();
|
||||||
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// Ignore.
|
// Ignore.
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue