File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
packages/react-native-performance/android/src/main/java/com/oblador/performance Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -187,7 +187,7 @@ private void emit(PerformanceMetric metric) {
187187 WritableMap map = Arguments .fromBundle (metric .getDetail ());
188188 params .putMap ("detail" , map );
189189 }
190- if (getReactApplicationContext ().hasActiveCatalystInstance ()) {
190+ if (getReactApplicationContext ().hasActiveReactInstance ()) {
191191 getReactApplicationContext ()
192192 .getJSModule (DeviceEventManagerModule .RCTDeviceEventEmitter .class )
193193 .emit ("metric" , params );
@@ -202,9 +202,11 @@ private void emit(PerformanceMark mark) {
202202 WritableMap map = Arguments .fromBundle (mark .getDetail ());
203203 params .putMap ("detail" , map );
204204 }
205- getReactApplicationContext ()
206- .getJSModule (DeviceEventManagerModule .RCTDeviceEventEmitter .class )
207- .emit ("mark" , params );
205+ if (getReactApplicationContext ().hasActiveReactInstance ()) {
206+ getReactApplicationContext ()
207+ .getJSModule (DeviceEventManagerModule .RCTDeviceEventEmitter .class )
208+ .emit ("mark" , params );
209+ }
208210 }
209211
210212 @ Override
@@ -222,6 +224,6 @@ public void onCatalystInstanceDestroy() {
222224
223225 // Fix new arch runtime error
224226 public void addListener (String eventName ) {
225-
227+
226228 }
227229}
You can’t perform that action at this time.
0 commit comments