Skip to content

Commit 6089a39

Browse files
authored
Merge pull request #626 from AlAskalany/patch-1
Fix issue #26
2 parents 71fcebb + 7a576f0 commit 6089a39

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -731,8 +731,12 @@ private String getHeaderIgnoreCases(HashMap<String,String> headers, String field
731731
}
732732

733733
private void emitStateEvent(WritableMap args) {
734-
RNFetchBlob.RCTContext.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
735-
.emit(RNFetchBlobConst.EVENT_HTTP_STATE, args);
734+
try {
735+
RNFetchBlob.RCTContext.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
736+
.emit(RNFetchBlobConst.EVENT_HTTP_STATE, args);
737+
} catch (Exception e) {
738+
FLog.e("RNFetchBlobReq", "Error emitting state event", e);
739+
}
736740
}
737741

738742
@Override

0 commit comments

Comments
 (0)