Skip to content

Commit

Permalink
fix(android): ensuring mReactApplicationContext is valid
Browse files Browse the repository at this point in the history
  • Loading branch information
ewindso committed Feb 17, 2025
1 parent 33d97d0 commit 64f1dda
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/react-native/android/src/oldarch/HotUpdaterModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ class HotUpdaterModule internal constructor(

// Ensure UI updates on the main thread
launch(Dispatchers.Main) {
mReactApplicationContext
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
.emit("onProgress", params)
if (mReactApplicationContext.hasActiveCatalystInstance()) {
mReactApplicationContext
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
.emit("onProgress", params)
}
}
}
}
Expand Down

0 comments on commit 64f1dda

Please sign in to comment.