mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-10 09:12:46 +08:00
fix release builds throwing errors / accessing null objects
Reviewed By: zjj010104 Differential Revision: D2816705 fb-gh-sync-id: 0873fd26b3b34fb56abf5ed033198f1b1d84057f
This commit is contained in:
committed by
facebook-github-bot-8
parent
bb73e98513
commit
73be933d09
@@ -9,6 +9,7 @@
|
||||
|
||||
package com.facebook.react.devsupport;
|
||||
|
||||
import com.facebook.react.bridge.DefaultNativeModuleCallExceptionHandler;
|
||||
import com.facebook.react.bridge.ReactContext;
|
||||
import com.facebook.react.bridge.ReadableArray;
|
||||
import com.facebook.react.modules.debug.DeveloperSettings;
|
||||
@@ -19,6 +20,12 @@ import com.facebook.react.modules.debug.DeveloperSettings;
|
||||
*/
|
||||
public class DisabledDevSupportManager implements DevSupportManager {
|
||||
|
||||
private final DefaultNativeModuleCallExceptionHandler mDefaultNativeModuleCallExceptionHandler;
|
||||
|
||||
public DisabledDevSupportManager() {
|
||||
mDefaultNativeModuleCallExceptionHandler = new DefaultNativeModuleCallExceptionHandler();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showNewJavaError(String message, Throwable e) {
|
||||
|
||||
@@ -111,6 +118,6 @@ public class DisabledDevSupportManager implements DevSupportManager {
|
||||
|
||||
@Override
|
||||
public void handleException(Exception e) {
|
||||
|
||||
mDefaultNativeModuleCallExceptionHandler.handleException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ import com.facebook.react.common.ReactConstants;
|
||||
public class AnimationsDebugModule extends ReactContextBaseJavaModule {
|
||||
|
||||
private @Nullable FpsDebugFrameCallback mFrameCallback;
|
||||
private final DeveloperSettings mCatalystSettings;
|
||||
private @Nullable final DeveloperSettings mCatalystSettings;
|
||||
|
||||
public AnimationsDebugModule(
|
||||
ReactApplicationContext reactContext,
|
||||
@@ -47,7 +47,8 @@ public class AnimationsDebugModule extends ReactContextBaseJavaModule {
|
||||
|
||||
@ReactMethod
|
||||
public void startRecordingFps() {
|
||||
if (!mCatalystSettings.isAnimationFpsDebugEnabled()) {
|
||||
if (mCatalystSettings == null ||
|
||||
!mCatalystSettings.isAnimationFpsDebugEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user