Skip to content

Commit 8be38f8

Browse files
authored
Merge pull request joltup#215 from jonthanon/master
Null check HashMap's get result in ReactNativeBlobUtilReq instead of checking for key first, to prevent potential async issues
2 parents aaec2c7 + 172e4a8 commit 8be38f8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

android/src/main/java/com/ReactNativeBlobUtil/ReactNativeBlobUtilReq.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ else if (arrayBody != null)
155155
}
156156

157157
public static void cancelTask(String taskId) {
158-
if (taskTable.containsKey(taskId)) {
159-
Call call = taskTable.get(taskId);
158+
Call call = taskTable.get(taskId);
159+
if (call != null) {
160160
call.cancel();
161161
taskTable.remove(taskId);
162162
}

0 commit comments

Comments
 (0)