Skip to content

Commit 7a576f0

Browse files
authored
Update RNFetchBlobReq.java
1 parent 39e4a45 commit 7a576f0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,9 +727,11 @@ private String getHeaderIgnoreCases(HashMap<String,String> headers, String field
727727
}
728728

729729
private void emitStateEvent(WritableMap args) {
730-
if (RNFetchBlob.RCTContext.hasActiveCatalystInstance()) {
730+
try {
731731
RNFetchBlob.RCTContext.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
732732
.emit(RNFetchBlobConst.EVENT_HTTP_STATE, args);
733+
} catch (Exception e) {
734+
FLog.e("RNFetchBlobReq", "Error emitting state event", e);
733735
}
734736
}
735737

0 commit comments

Comments
 (0)