mirror of
https://github.com/samsonjs/media.git
synced 2026-04-14 12:45:47 +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) {
|
||||
try {
|
||||
dataSource.close();
|
||||
if (dataSource != null) {
|
||||
dataSource.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
// Ignore.
|
||||
}
|
||||
|
|
@ -224,7 +226,9 @@ public final class Util {
|
|||
*/
|
||||
public static void closeQuietly(Closeable closeable) {
|
||||
try {
|
||||
closeable.close();
|
||||
if (closeable != null) {
|
||||
closeable.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
// Ignore.
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue