Skip to content

Commit d872c24

Browse files
committedSep 16, 2014
Clean code
1 parent 5b1e588 commit d872c24

File tree

1 file changed

+6
-6
lines changed
  • library/src/com/nostra13/universalimageloader/utils

1 file changed

+6
-6
lines changed
 

‎library/src/com/nostra13/universalimageloader/utils/IoUtils.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -104,18 +104,18 @@ public static void readAndCloseStream(InputStream is) {
104104
final byte[] bytes = new byte[DEFAULT_BUFFER_SIZE];
105105
try {
106106
while (is.read(bytes, 0, DEFAULT_BUFFER_SIZE) != -1);
107-
} catch (IOException e) {
108-
// Do nothing
107+
} catch (IOException ignored) {
109108
} finally {
110109
closeSilently(is);
111110
}
112111
}
113112

114113
public static void closeSilently(Closeable closeable) {
115-
try {
116-
closeable.close();
117-
} catch (Exception e) {
118-
// Do nothing
114+
if (closeable != null) {
115+
try {
116+
closeable.close();
117+
} catch (Exception ignored) {
118+
}
119119
}
120120
}
121121

0 commit comments

Comments
 (0)
Please sign in to comment.