From 52cdb93e44116ca86d45919a3e76472a00ef97c0 Mon Sep 17 00:00:00 2001 From: Thomas Parslow Date: Wed, 25 May 2022 15:33:03 +0100 Subject: [PATCH] Check if newConfig is null Not sure why it could be null, but I know it being null has caused at least one crash in production --- .../java/com/github/yamill/orientation/OrientationModule.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/android/src/main/java/com/github/yamill/orientation/OrientationModule.java b/android/src/main/java/com/github/yamill/orientation/OrientationModule.java index 582cf993..6f91a1d2 100644 --- a/android/src/main/java/com/github/yamill/orientation/OrientationModule.java +++ b/android/src/main/java/com/github/yamill/orientation/OrientationModule.java @@ -56,6 +56,9 @@ public OrientationModule(ReactApplicationContext reactContext) { @Override public void onReceive(Context context, Intent intent) { Configuration newConfig = intent.getParcelableExtra("newConfig"); + if (newConfig == null) { + return; + } Log.d("receiver", String.valueOf(newConfig.orientation)); String orientationValue = newConfig.orientation == 1 ? "PORTRAIT" : "LANDSCAPE";