Skip to content

Commit 993a03a

Browse files
committed
Fixed mkdirs assertion, mkdirs can return false if directories already exist
1 parent 390b6f5 commit 993a03a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

library/src/main/java/com/loopj/android/http/FileAsyncHttpResponseHandler.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ public FileAsyncHttpResponseHandler(File file) {
5353
public FileAsyncHttpResponseHandler(File file, boolean append) {
5454
super();
5555
Utils.asserts(file != null, "File passed into FileAsyncHttpResponseHandler constructor must not be null");
56-
Utils.asserts(file.getParentFile().mkdirs(), "Cannot create parent directories for requested File location");
56+
if (!file.getParentFile().isDirectory()) {
57+
Utils.asserts(file.getParentFile().mkdirs(), "Cannot create parent directories for requested File location");
58+
}
5759
this.mFile = file;
5860
this.append = append;
5961
}

0 commit comments

Comments
 (0)