Skip to content

Commit 172e4a8

Browse files
author
Jonathon Brammer
committed
Null check HashMap's get result in ReactNativeBlobUtilReq instead of checking for key first, to prevent potential async issues
1 parent 2e14e6b commit 172e4a8

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)