mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
RedBoxDialogSurfaceDelegate crash fix (#47249)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/47249 - It is likely that Dialog is being dismissed from an invalid state causing an exception - apply similar changes from D63712422 which is to add try/catch around and ignore the exception as we are dismissing the dialog anyway Changelog: [Internal] Reviewed By: javache Differential Revision: D65066186 fbshipit-source-id: 03ebbc3fec3adf6100e36ea38b43f410d98a5297
This commit is contained in:
committed by
Facebook GitHub Bot
parent
c19fd11ccf
commit
97622a5caa
+6
-1
@@ -144,7 +144,12 @@ class RedBoxDialogSurfaceDelegate implements SurfaceDelegate {
|
||||
public void hide() {
|
||||
// dismiss redbox if exists
|
||||
if (mDialog != null) {
|
||||
mDialog.dismiss();
|
||||
try {
|
||||
mDialog.dismiss();
|
||||
} catch (IllegalArgumentException e) {
|
||||
FLog.e(
|
||||
ReactConstants.TAG, "RedBoxDialogSurfaceDelegate: error while dismissing dialog: ", e);
|
||||
}
|
||||
destroyContentView();
|
||||
mDialog = null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user