Skip to content

Commit f42c891

Browse files
committed
Replaced assert calls with AssertUtils.asserts, which are handled properly in release mode
1 parent 1e5dbf4 commit f42c891

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public abstract class FileAsyncHttpResponseHandler extends AsyncHttpResponseHand
4141
*/
4242
public FileAsyncHttpResponseHandler(File file) {
4343
super();
44-
assert (file != null);
44+
AssertUtils.asserts(file != null, "File passed into FileAsyncHttpResponseHandler constructor must not be null");
4545
this.mFile = file;
4646
}
4747

@@ -71,8 +71,10 @@ public boolean deleteTargetFile() {
7171
* @return temporary file or null if creating file failed
7272
*/
7373
protected File getTemporaryFile(Context context) {
74-
assert (context != null);
74+
AssertUtils.asserts(context != null, "Tried creating temporary file without having Context");
7575
try {
76+
// not effective in release mode
77+
assert context != null;
7678
return File.createTempFile("temp_", "_handled", context.getCacheDir());
7779
} catch (IOException e) {
7880
Log.e(LOG_TAG, "Cannot create temporary file", e);

0 commit comments

Comments
 (0)